1. Get rid of all advertisements and get unlimited access to documents by upgrading to Premium Membership. Upgrade to Premium Now and also get a Premium Badge!

How to Display the details of emp, who do not have any person working under them.

Discussion in 'SQL PL/SQL' started by Vicky, Aug 16, 2014.

  1. Vicky

    Vicky Forum Advisor

    Messages:
    261
    Likes Received:
    11
    Trophy Points:
    260
    Location:
    Chennai
    How to Display the details of employees, who do not have any person working under them...
     
  2. zargon

    zargon Community Moderator Forum Guru

    Messages:
    2,347
    Likes Received:
    348
    Trophy Points:
    1,430
    Location:
    Aurora, CO
    Re: How to Display the details of emp, who do not have any person working under them

    It's pretty easy:


    select *
    from employees
    where employee_id not in (select manager_id from employees);




    IF some manager_ids are NULL you need to address that in your query.