SQL一些常用的关键字
1、Having,跟where一样用于过滤但是where用于过滤行,而having用于过滤分组。
#列出至少有两个订单的所有顾客
select cust_id, count(*) as orders from orders group by cust_id having
count(*) >=2;
#列出至少有两个订单的所有顾客
select cust_id, count(*) as orders from orders group by cust_id having
count(*) >=2;
本文标题:SQL一些关键字
本文链接:https://www.haomeiwen.com/subject/wsoapftx.html
网友评论