Hi..
i have a question that what is the difference between HAVING and WHERE?
what ever I have read articles i did not get proper answer...
can any one define please..
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Pravin MorePosted Sep 21, 2011, 1:43 AM
major difference between (Having and Where) is having is used against aggregate function(like sum,count etc) and where clause not allow use of aggregate function
like e.g select ID from Table_name group by ID having count(assets) >5
hope you get answer.
Thanx,
pravin.
Hemant KumarPosted Sep 21, 2011, 2:15 AM
You can have WHERE without HAVING, you can have HAVING without WHERE, you can have both WHERE and HAVING, and you can have neither WHERE nor HAVING. But you can't have HAVING without grouping, even if the group consists of the entire result set.
A good example of the difference between WHERE and HAVING is given in my earlier answer Why WHERE cannot be used after GROUP BY.
Kanhialal kkPosted Sep 21, 2011, 1:53 AM
can you help me to create trigger on a table with query...
please.