原帖由 [bold][underline]madpbpl[/underline][/bold] 于 2007-12-18 23:15 发表 [url=http://bbs.bc-cn.net/redirect.php?goto=findpost&pid=1153438&ptid=193020]

[/url]
select sum(jj) as jjtotal,sum(sl) as sltotal,ph,min(dj),min(mp) from aa group by ph
or
select sum(jj) as jjtotal,sum(sl) as sltotal,ph,mxa(dj),max(mp) from aa group by ph
madpbpl 考虑得非常周到, mq 取其
max 或 min , dj 取其 max 或 min ,因为 mq 或 dj 会有多条记录 又或者不相同的记录,
而取其一.
但运行时还是有问题, 我把其中的 total 去掉,统计就正确了,但不能获得 mq和dj的数据.
请教madpbpl怎么样才能获得 mq和dj的数据?谢谢!