P panduola Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-30 #1 我对一个字段用求和,怎么根据求和后的数据查询,这样的sql语句 Select id,sum(MNY) From zj where sum(MNY) 后面的条件不对,应给怎么该
B brown0432 Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-30 #2 select id,sum(mny) as a from zj where a
N nickylin Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-30 #3 select id,sum(mny) from zj group by id having sum(mny)
C Carson_zzd Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-30 #4 应该是用 select Id,Sum(mny) from zj having Sun(mny) + '条件' 因为where 条件中不能包含from 表中没有的字段 而having则可以
N nickylin Unregistered / Unconfirmed GUEST, unregistred user! 2002-12-30 #5 要group by才对的。 如果没有,会有以下错误提示: Column 'zj.id' is invalid in the select list because it is not contained in an aggregate function and there is no GROUP BY clause.
要group by才对的。 如果没有,会有以下错误提示: Column 'zj.id' is invalid in the select list because it is not contained in an aggregate function and there is no GROUP BY clause.