奥礼网
新记
having 和where是否可同时使用?
having和where同时使用的例子?
举报该文章
相关建议 推荐于2018-02-28
可以。example
select count(*), person_id
from per_all_people_f
where sysdate between effective_start_date and effective_end_date
group by person_id
having count(*) > 1
温馨提示:内容为网友见解,仅供参考
当前网址:
https://aolonic.com/aa/n1n31k343.html
其他看法
第1个回答 2012-05-17
where用于前面的过滤,having用于后面groupby后的过滤,两者不冲突。完全可以同时使用。
第2个回答 2012-05-17
当然可以。
where是在汇总之前进行筛选;
having 是在汇总之后进行筛选。
相似回答
大家正在搜
相关问题
各位老大,WHERE和HAVING可以同时在SQL中使用吗
SQL中where和group by可以连用吗?having...
在oracle中having为什么不能和where一起用
group by不能跟where一起用吗?
数据库中having 和where有什么区别
SQL语言中where和having有什么区别?
SQL中where和group by可以连用吗?having...
7、SELECT语句中与HAVING子句同时使用的是( )子...