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