摘要:
Where & Having简单讲:having支持所有where操作符,唯一的差别就是where过滤行,having过滤分组。Select product_id,Count(*) as orders from productsGroup by product_idHaving Count(*)>=2输出结果如下:01 3可以这样说:where在数据分组前进行过滤,having在数据分组后进行过滤需要注意的是:having与group by不适用的数据类型为text、ntext、imageGroup by & Order byGroup by:分组行,但输出可能不是分组的 阅读全文
posted @ 2012-07-22 17:27
pain1033
阅读(209)
评论(0)
推荐(0)
浙公网安备 33010602011771号