COMPUTER SCIENCE AND ENGINEERING
SQL
Question
[CLICK ON ANY CHOICE TO KNOW THE RIGHT ANSWER]
|
Which clause should you use to exclude group results in a query using group functions?
|
WHERE
|
|
HAVING
|
|
GROUP BY
|
|
ORDER BY
|
Explanation:
Detailed explanation-1: -To exclude some group results, use Having-clause. GROUP BY dept; This is because the group function cannot be used in WHERE clause.
Detailed explanation-2: -Use the WHERE clause to exclude rows you do not want grouped, and use the HAVING clause to filter records after they have been grouped.
Detailed explanation-3: -Clause Use to Exclude Group Results.
Detailed explanation-4: -The GROUP BY clause is used with the SELECT statement to make a group of rows based on the values of a specific column or expression. The SQL AGGREGATE function can be used to get summary information for every group and these are applied to an individual group.
There is 1 question to complete.