求一条Sql语句~,再线等~~,解决立即给分
有如下两个表
dechead 主表
copentryno, ieflag, ieport ,ddate....
declist 明细表
copentryno, qty, usdprice,assgs...
dechead.copentryno = declist.copentryno
ieflag 只有两种取值‘I’‘E’
现在统计每一天的ieport的 ieflag = 'I' 的 qty*usdprice 和 ieflag = ‘E’的Qty* usdprice
(就是根据ieprot和ddate分组)
要求一条Sql语句搞定。。不能写成两条。。多谢