[B]Question asked by Guest Visitor ramesh[/B]
there is two tables emp and dept i want query for this one
max sal of employe and employee name who is not in dept no 30
dept no columin is in dept ,empid is common coulumn in two tables
Printable View
[B]Question asked by Guest Visitor ramesh[/B]
there is two tables emp and dept i want query for this one
max sal of employe and employee name who is not in dept no 30
dept no columin is in dept ,empid is common coulumn in two tables
I assume that empid column in both emp and dept table.
select emp_id,emp_name
from emp,dept
where emp.emp_id=dept.emp_id
and dept_id !=30
and emp.salary =(select max(salary)
from employee
where emp_id not in (select emp_id
from dept
where dept_id !=30
)
)