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
Printable View
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
SELECT DISTINCT SubClassID
FROM Chemicals c
WHERE SubClassID NOT IN (
SELECT SubClassID
FROM Chemicals s
WHERE MolMass >= 400
GROUP BY SubClassID)
many thanks for your help !:D