求一条sql的合并语句?
NO: MARK:
1 11
1 22
2 9
3 13
3 23
2 5
NO按升序合并相同的纪录,合并成:
1 33
2 14
3 25
[解决办法]
select no, sum(mark) as mark from tbl group by no order by no
*****************************************************************************
欢迎使用CSDN论坛专用阅读器 : CSDN Reader(附全部源代码)
最新版本:20070130
http://www.cnblogs.com/feiyun0112/archive/2006/09/20/509783.html
[解决办法]
select no,sum(mark) as mark from tb group by no order by no
[解决办法]
NO: MARK:
1 11
1 22
2 9
3 13
3 23
2 5
select distinct no,(select sum(mark) from ta b where b.no=a.no) from ta a