当前位置:编程学习 > C#/ASP.NET >>

SQL group by 的用法那位高手帮帮菜鸟呀 要带例子的 谢谢

SQL group by 的用法那位高手帮帮菜鸟呀 要带例子的 谢谢  --------------------编程问答-------------------- 比如tb表有这样的结构:
name  num
a          13
b          33
a          10
select  name, sum(num) as total from tb group by name
结果如下:
name  num
a           23
b           13
--------------------编程问答-------------------- select a,b,c,d....sum(字段)over(partition by c) from(
     select
        max(b) b,
        max(c) c,
        max(d) d,
        ...,
        a
     from table
     group by a
)

http://www.google.com.hk/search?hl=zh-CN&newwindow=1&safe=strict&biw=1420&bih=742&q=sql+group+by&btnG=Google+%E6%90%9C%E7%B4%A2&aq=f&aqi=&aql=&oq=
补充:.NET技术 ,  C#
CopyRight © 2012 站长网 编程知识问答 www.zzzyk.com All Rights Reserved
部份技术文章来自网络,