Home > Backend Development > PHP Tutorial > 问个SQL查询话语

问个SQL查询话语

WBOY
Release: 2016-06-13 12:35:42
Original
899 people have browsed it

问个SQL查询语句
有个客户表,其中一个字段里面存储的是电话号码,客户每买一次就登录一次电话号码,我现在想查询这个字段重复记录最多的,并且依次排列出来,这个SQL应该怎么写呢。

客户表名称 partylist
存储客户电话号码的字段是 phonum  varchar(15)

表的结构大概是这样

张三  北京   0108956878
李四  上海    021545787
小小   上海   13800138000
小四   上海   13800138000
小吴   广州   0205855843

比如查询出来的结果是

13800138000  29次 小王
020184587    18次  小李

这样的,谢谢各位

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template