查询结果中出现行号(适用于按名次排序)

SELECT @rowno:=@rowno + 1 AS rowno,COUNT(id),phone FROM tbl_hh,(SELECT @rowno:=0) b GROUP BY phone ORDER BY COUNT(id) DESC

posted on 2017-12-16 19:12  zxc旭  阅读(224)  评论(0编辑  收藏  举报