常用Sql示例

来源:互联网 发布:淘宝订单险坑卖家钱 编辑:程序博客网 时间:2024/05/16 19:37

group by having语法:

select column1,       column2from table1,     table2where [ conditions ]group by column1,         column2 having [ conditions ]order by column1,         column2;

例子:

select Customer,       SUM(OrderPrice)from Orderswhere Customer='Bush'  or Customer='Adams'group by Customer having SUM(OrderPrice)>1500;



0 0
原创粉丝点击