MSAccess/SQL question **PICS**

Discussion in 'OT Technology' started by elevator, May 7, 2007.

  1. elevator

    elevator The tenants think it's wonderful! ヽ(´ OT Supporter

    Joined:
    Mar 25, 2005
    Messages:
    10,967
    Likes Received:
    0
    Location:
    Houston, TX
    I want to use a MINUS type operation but I am using Access, not Oracle. What I need: To find The Salespeople that live in Copenhagen but have not sold any P8. (Olsen)

    meh Tables:
    [​IMG]

    I could do this with Oracle, but I am to mold it to Access and I'm an Access n00b. thanks OT
     
  2. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    Code:
    SELECT DISTINCT s.SName AS `name`
    FROM `SP` p, `S` s
    WHERE p.PID <> "P8" AND s.City = "Copenhagen" AND p.SID=s.SID;
    


    that work for you?
     
  3. elevator

    elevator The tenants think it's wonderful! ヽ(´ OT Supporter

    Joined:
    Mar 25, 2005
    Messages:
    10,967
    Likes Received:
    0
    Location:
    Houston, TX
    SELECT sname
    FROM s
    WHERE s.sid not in
    (select distinct sp.sid from sp, s where s.SID = sp.SID AND sp.pid = 'P8')
    and s.city = 'Copenhagen';
     
  4. elevator

    elevator The tenants think it's wonderful! ヽ(´ OT Supporter

    Joined:
    Mar 25, 2005
    Messages:
    10,967
    Likes Received:
    0
    Location:
    Houston, TX
    OK, I think I am suppose to do this one with nested DIFFERENCE.

    [FONT=&quot]24. Show the names and quota of salespeople who have an order with [/FONT][FONT=&quot]all customers[/FONT][FONT=&quot]. [/FONT]


    [​IMG]
     
  5. 5Gen_Prelude

    5Gen_Prelude There might not be an "I" in the word "Team", but

    Joined:
    Mar 14, 2000
    Messages:
    14,519
    Likes Received:
    1
    Location:
    Vancouver, BC, CANADA
    Uh ro - sounds like homework!
     
  6. P07r0457

    P07r0457 New Member

    Joined:
    Sep 20, 2004
    Messages:
    28,491
    Likes Received:
    0
    Location:
    Southern Oregon
    yea, I'm done helping ya if it's homework.
     

Share This Page