SitePoint Sponsor

User Tag List

Results 1 to 17 of 17

Threaded View

  1. #1
    SitePoint Wizard bbolte's Avatar
    Join Date
    Nov 2001
    Location
    The Central Plains
    Posts
    3,304
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    sql statement help needed

    ok, this is for a class and i've been working on this for 2 hours. here is the data i need to find: "List the entertainers who played engagements for customer Bonnicksen but did not play any engagements for Rosales."

    here is my sql statement: SELECT bonnickson.EntStageName
    FROM
    [SELECT DISTINCT Entertainers.EntStageName
    FROM (Entertainers
    INNER JOIN Engagements ON Engagements.EntertainerID = Entertainers.EntertainerID)
    INNER JOIN Customers ON Engagements.CustomerID = Customers.CustomerID
    WHERE Customers.CustomerID = 10011]. AS bonnickson
    LEFT OUTER JOIN
    [SELECT DISTINCT Entertainers.EntStageName
    FROM (Entertainers
    INNER JOIN Engagements ON Engagements.EntertainerID = Entertainers.EntertainerID)
    INNER JOIN Customers ON Engagements.CustomerID = Customers.CustomerID
    WHERE Customers.CustomerID = 10014]. AS rosales
    ON bonnickson.EntStageName = rosales.EntStageName

    this statement returns 7 rows, i believe the answer should be 3 rows. i did each inner select by themselves and compared, their were only 3 that never played for rosales. this is an access db. can anyone see from this where my mistake is or do you need to see more info?

    i have some screen shots posted here
    Last edited by bbolte; Feb 11, 2002 at 22:57.


Bookmarks

Posting Permissions

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