1)Friends i have a BIG confusion with HAVING CLAUSE.

Syntax:
HAVING

In this expression part we use some normal columns(ex: HAVING deptno=20),Group function on some column(ex HAVING max(sal)>3000) or both combination of normal column and group function(ex: HAVING max(sal)>3000 and deptno=20).
Now, the columns which we are using in HAVING CLAUSE (in above examples sal,deptno) do they need to be present in both SELECT CLAUSE and GROUP BY CLAUSE or in either of the clause or they need not present in SELECT and GROUP BY clause.
I have tried a lot to get the answer for it but nobody has given a clear answer.
Friends please help me with this having clause GHOST its haunting me.

2)Query to retrieve the deptno of the employee who gets highest salary paid

SELECT deptno FROM emp HAVING sal=MAX(sal);
i am getting error.
Though there are many ways to get the answer for this query i want to know why this query dosent work as HAVING CLAUSE acts like WHERE CLAUSE in the absence of GROUP BY CLAUSE.
Thanks & regards