Answer the question
In order to leave comments, you need to log in
MySQL. How to write a query with a subquery?
There is a product table , in this table there are 3 fields: maker (manufacturer), model (product model) and type (product type).
I'm required to list manufacturers that make pc but don't make laptop .
This is the query I got:
SELECT DISTINCT maker FROM product
WHERE type LIKE "PC%" AND type <> (
SELECT DISTINCT maker FROM product
WHERE type LIKE "Laptop%");
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question