Given the following two statements about SQL. (A) An SQL query can contain HAVING clause only if it has GROUP BY clause.
Given the following two statements about SQL.
(A) An SQL query can contain HAVING clause only if it has GROUP BY clause.
(B) In an SQL query "SELECT_FROM_WHERE_GROUP BY_HAVING". HAVING is executed before WHERE.
Which of the following is correct?
Show answerHide answer
Correct answer: (D) (A) and (B) both are false
Explanation
Corrected: the book's key says (b). HAVING can be used without GROUP BY (the whole result is one group), and WHERE is applied before HAVING, so both statements are false.