‘Where’ and ‘Having’ clause both are used to filter the rows fetched from select statement however there is a difference:
1.Using where clause we can restrict or filter the records that we get from select statement.
2.Having clause is used to restrict the records that are grouped using group by clause.
3.Having clause is just like where clause but it can be used only with group by as we cannot use where clause in group by.Having clause works or can be used, only in the combination with group by clause.
Refer for detail: http://newtonapples.com/difference-clause-clause/
No comments:
Post a Comment