oracle - SQL - about HAVING clause -
below sample question oracle
q) of following statements true having? (choose two.)
a. can used in select statement.
b. must occur after group clause.
c. must occur after clause.
d. cannot reference expression unless expression first reference in group clause.
to me, answers should & b. actual answers & c. "having cannot used without group by, not required follow group by".
is statement correct? please advice.
no, isn't. aggregation doesn't need group clause, hence having can used without one.
example: give me maximum salary, if minimum salary greater 1000.
select max(salary) salaries having min(salary) > 1000; a , c correct, not reason given.
Comments
Post a Comment