435 views
2 2 votes
In SQL-92 (which is what GATE assumes), which columns are allowed in SELECT and HAVING, when GROUP BY is present or not ?

Which columns/attributes can be aggregated or non aggregated in SELECT and HAVING?

I can't find good, clear info relating this.

1 Answer

0 0 votes
SELECT and HAVING have different purposes. A better comparison would be between WHERE and HAVING.

 

WHERE is to place a condition to select rows that match the condition.

HAVING is used along with GROUP BY only, as its function is to select only those groups that match the given condition. As you know, GROUP BY is used only with an aggregate function.

Hope this answers the question.
Position:
Show:

Related questions

4 4 votes
4 4 answers
4.1k
4.1k views
Tuhin Dutta asked May 27, 2019
4,149 views
In a relation, if every attribute is prime but key may not be simple then the relation is in ______.A. 1NFB. 2NFC. 3NFD. BCNF
1 1 vote
1 answers 1 answer
1.2k
1.2k views
tishhaagrawal asked Dec 16, 2023
1,174 views
My doubt here is, if NOT EXISTS gets an empty set as the input then every tuple of the table in the outer query must satisfy the condition. Am I right?For example, in the...
0 0 votes
2 2 answers
2.9k
2.9k views
Pooja Khatri asked Jul 13, 2018
2,920 views
Consider a relation book (title, price) which contains the titles and prices of different books. Assuming that no two books have the same price, what does the following S...
4 4 votes
1 answers 1 answer
6.3k
6.3k views
go_editor asked Aug 14, 2016
6,318 views
In a relational database model, NULL values canbe used for all but which one of the following?To allow duplicate tuples in the table by filling the primary key column(s) ...