W wsd Unregistered / Unconfirmed GUEST, unregistred user! 2001-06-08 #1 select distinct studentname ,sum(student_buy) from stutable 这句SQL有什麽错? 其中studentname ,student_buy是两个字段
select distinct studentname ,sum(student_buy) from stutable 这句SQL有什麽错? 其中studentname ,student_buy是两个字段
X xie_p_f Unregistered / Unconfirmed GUEST, unregistred user! 2001-06-08 #2 有聚合的查询要用group by的哦 改为 select distinct studentname,sum(student_buy) from stutable group by studentname ^^^^^^^^^^^^^^^^^^^^^
有聚合的查询要用group by的哦 改为 select distinct studentname,sum(student_buy) from stutable group by studentname ^^^^^^^^^^^^^^^^^^^^^
飞 飞龙在天 Unregistered / Unconfirmed GUEST, unregistred user! 2001-06-08 #3 应该是 select studentname, sum(student_buy) from stutable group by studentname