Skip to Main Content

SQL & PL/SQL

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Using the HAVING clause

1024267Jul 10 2013 — edited Jul 11 2013

I'm having difficulty understand the following query:

SELECT cust_city, COUNT(cust_last_name)

FROM customers

WHERE cust_credit_limit > 1000

GROUP BY cust_city

HAVING AVG(cust_credit_limit) BETWEEN 5000 AND 6000

According to my exam prep, this will run successfully without errors, though I don't understand why.

Doesn't the AVG(cust_credit_limit) also need to be included in with the rest of the fields for this to work properly?

It would be greatly appreciated if someone could explain this better to me.

Thanks,

Sean

This post has been answered by unknown-7404 on Jul 10 2013
Jump to Answer
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Aug 8 2013
Added on Jul 10 2013
5 comments
2,450 views