货物表 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 +---------+---------+-----------+-<
String sqlCount="select count(*) from usertable where username='"+ userName+"'";这句话 什么意思啊! 这句话输出出来就是 select count(*) from usertable where username='你的变量 ......