几个字段 zh账号,fse发生额,jyrq交易日期!我想把某个账号下在一段日期内,发生额总数>500000的数据筛出来,请问怎么写阿?select zh,sum(fse),jyrq from table where jyrq>'2010-05-09' and jyrq<'2010-05-11' where sum(fse)>500000 group by .....?还是在判断语句中用having sum(fse)>500000?
调试欢乐多
from [table]
where jyrq>'2010-05-09' and jyrq<'2010-05-11'
group by zh,jyrq
having sum(fse)>500000
select zh,sum(fse),jyrq from table where jyrq>'2010-05-09' and jyrq<'2010-05-11' group by zh having sum(fse)>500000
select zh,sum(fse),jyrq from table where jyrq>'2010-05-09' and jyrq<'2010-05-11' group by zh,jyrq having sum(fse)>500000
from tble
where jyrq>'2010-05-09' and jyrq<'2010-05-11'
group by zh,jyrq
having sum(fse)>'50000'