»õÎï±í goods( g_id int, quality int, person_id int ) ÆäÖÐperson_idÊÇperson±íµÄÖ÷¼ü£¬±íʾ»õÎïÓµÓÐÈË¡£ ÐèÇó£º ÇóÓµÓлõÎïÊýÁ¿×î¶àµÄÇ°10ÃûÈËÎï¡£Ìù¼Ç¼¼°ÒªÇó½á¹û³öÀ´¿´¿´£¬TRY SELECT person_id,SUM(quality) from TT GROUP BY person_id ORDER BY SUM(quality) DESC LIMIT 10
quality Ö»ÊǸöÖÊÁ¿´úºÅ£¬ÔÙÏëÏë¿´£º ÓµÓлõÎïÊýÁ¿×î¶àµÄÇ°10ÃûÈËÎï Ìù¼Ç¼¼°ÒªÇó½á¹û³öÀ´¿´¿´ select person_id,count(g_id) num from goods group by person_id order by num desc limit 10 ûÓп´µ½ÄãµÄ¼Ç¼ SELECT person_id,count(*) from TT GROUP BY person_id ORDER BY count(*) DESC LIMIT 10 +---------+---------+-----------+-<