Results 1 to 2 of 2

Thread: Query employee name who is not in dept no 30

  1. #1
    Geek_Guest
    Guest

    Query employee name who is not in dept no 30

    Question asked by Guest Visitor ramesh

    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


  2. #2
    Expert Member
    Join Date
    Jun 2006
    Answers
    410

    Re: Query employee name who is not in dept no 30

    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
    )
    )


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact