You are viewing a single comment's thread. Return to all comments →
Why does it give wrong answer if I use HAVING clause instead of WHERE clause?
paste your code here and we can take a look.
hope ur code is like "select name,salary,months from employee having salary >2000 and months < 10 order by employee_id;" sal,months are not expected in output.
HAVING is used with GROUP BY and not ORDER BY.
In the question you have been asked to sort according to the employee_id. This can be done by using ORDER BY.