Results 1 to 3 of 3

Thread: problem with a self join...

  1. #1
    Join Date
    Jan 2003
    Posts
    3

    Question problem with a self join...

    I'm a newbie in sql queries and don't know how to solve the following question:

    are there subclasses in which ALL chemicals have a MolMass < 400 ?

    relation given (prim. key: ChemID):

    Chemicals (ChemID, Name, MolMass, SubclassID)


    Many thanks

  2. #2
    Join Date
    Nov 2002
    Location
    DE
    Posts
    246
    SELECT DISTINCT SubClassID
    FROM Chemicals c
    WHERE SubClassID NOT IN (
    SELECT SubClassID
    FROM Chemicals s
    WHERE MolMass >= 400
    GROUP BY SubClassID)

  3. #3
    Join Date
    Jan 2003
    Posts
    3
    many thanks for your help !

Posting Permissions

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