DBAsupport.com Forums - Powered by vBulletin
Results 1 to 2 of 2

Thread: SQL query

  1. #1
    Join Date
    Nov 2000
    Posts
    416
    Does this query valid , can you interpret it and tell me how does is process

    SELECT name, department_id, salary
    FROM employee
    WHERE (department_id, salary) IN (SELECT department_id, salary
    FROM employee
    WHERE employee_id = &1)
    AND bonus IS NULL;

    An ounce of prevention is worth a pound of cure

  2. #2
    Join Date
    May 2000
    Location
    ATLANTA, GA, USA
    Posts
    3,135
    SELECT name, department_id, salary
    FROM employee
    WHERE (department_id, salary) IN (SELECT department_id, salary
    FROM employee
    WHERE employee_id = &1)
    AND bonus IS NULL;

    First convert this into plain english:
    Show me a list of Sales employees, their departments, and their salary where nobody got bonus and their departments and salary should match which Director of Sales.

    Your Query is a valid one.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  


Click Here to Expand Forum to Full Width