Results 1 to 3 of 3

Thread: Fully Qualified Query - Resolved

  1. #1

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2002
    Location
    Tulsa,Ok
    Posts
    262

    Fully Qualified Query - Resolved

    Guys,

    I am having a problem with a query. I am trying to select a single field from a table using three tables for the criteria.

    Here is the query:

    SELECT w.warehouse
    from warehouse as w, employee as e, department as d
    where e.department = 1 and d.warehouse = w.whID

    I am using a 1 since I am trying to test the query in the Query Analyzer prior to add it to the code.

    Thanks,

    Jerel
    Attached Images Attached Images  
    Last edited by Phenglai; Apr 12th, 2004 at 10:09 AM.

  2. #2
    Fanatic Member ahara's Avatar
    Join Date
    Nov 2003
    Location
    Toronto
    Posts
    531
    Hello;

    I can't run this query so I offer no guarantees - plus I am not sure what you are after - it looks like you want the warehouse associated with an employee of a particular department....at any rate - no harm in trying:

    SELECT w.warehouse
    FROM
    warehouse w, department d, employee e
    WHERE
    w.whid = d.warehouse AND
    d.deptID = e.department AND
    e.department = 1

    hope that helps - cheers
    "Knowledge is gained when different people look at the same information in different ways"

    - Louis Pasteur

  3. #3

    Thread Starter
    Hyperactive Member
    Join Date
    Jun 2002
    Location
    Tulsa,Ok
    Posts
    262
    That is it. I just missed a field.

    Thanks so much for your help.

    Jerel

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