jeudi 16 juin 2016

How do I find the makers that sell one type but not another?

I have to:

Find the makers that sell PCs but not laptops.

This query is not outputting correct result:

SELECT maker, type FROM product
WHERE type = 'PC' AND type <> 'Laptop'

Output from this and correct output:

output

Result set from this query:

SELECT maker, type FROM product

ex2

Table schema:

table

Even this one is not working:

SELECT maker, type FROM product
WHERE type IN('PC') AND type NOT IN('Laptop')

NOTE - type is added just for clarification

Aucun commentaire:

Enregistrer un commentaire