The HAVING clause is used in combination with the ORDER BY clause

Options
- TRUE
- FALSE


CORRECT ANSWER : FALSE

Discussion Board
HAVING IS USED WITH GROUP BY

it doesn''t matter if there is ORDER BY

Marek 04-15-2020 02:23 PM

why is that

so why the CORRECT ANSWER is FALSE ?

Ela 04-26-2018 11:21 AM

HAVING clause

The HAVING clause enables you to specify conditions that filter which group results appear in the final results. The WHERE clause places conditions on the selected columns, whereas the HAVING clause places conditions on groups created by the GROUP BY clause.

Syntax:

SELECT
FROM
WHERE
GROUP BY
HAVING
ORDER BY

The HAVING clause must follow the GROUP BY clause in a query and must also precede the ORDER BY clause if used.
The following is the syntax of the SELECT statement, including the HAVING clause:

SELECT column1, column2
FROM table1, table2
WHERE [ conditions ]
GROUP BY column1, column2
HAVING [ conditions ]
ORDER BY column1, column2

Prajakta Pandit 02-15-2017 05:40 AM

Confusing wording

The wording of this question is very confusing. HAVING can certainly be used in a query that contains an ORDER BY clause. For example, the following query is valid:

SELECT count(*), job_id
FROM hr.employees
GROUP BY job_id
HAVING count(*) > 2
ORDER BY job_id;

Doug 01-13-2017 11:39 AM

Write your comments


Enter the code shown above:

(Note: If you cannot read the numbers in the above image, reload the page to generate a new one.)


Advertisement