java - sql中having后面一般都跟函数,不能跟着表达式吗?
ringa_lee
ringa_lee 2017-04-18 10:00:52
0
2
400
ringa_lee
ringa_lee

ringa_lee

reply all(2)
巴扎黑

having后面跟一个条件表达式,name<2合理呀,单纯一个nameThat’s called an expression.

刘奇

You just need to remember that the relationship between having and group by is just like the relationship between where and select. Since you can write various conditions in where, you can also write in having. However, since it is already group by, it is generally used in having. For aggregate functions, like your SQL, mentioning the condition name<2 of having in front and writing it in where is the same as the result of this sentence, so it makes no sense to write this condition in having.

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!