How can i solve the query...?
Ename - DeptNo
Eno - DName
DeptNo - Location
Count the number of employees in each department and get the department which has least number of employees
If a table has one column named as 'X' type integer
it contains 3,5,10,-2,15,41,2 and so on
If we a number (i.e., that given number is in the above list) as input, get the immediate biggest number for that given one. (Query only not PL/SQL script)
( Select Dept_No, Count(*) Cnt From Emp Group By Dept_No Order By 2) A,
A.Dept_No = Dept.Dept_No And
Rownum < 2
"I Dont Want To Follow A Path, I would Rather Go Where There Is No Path And Leave A Trail."
"Ego is the worst thing many have, try to overcome it & you will be the best, if not good, person on this earth"
For the 2nd Qn,
select min(x) from table_a where x > :b1;
where b1 is your input value.
Click Here to Expand Forum to Full Width