getting customers with no orders sql

Solutions on MaxInterview for getting customers with no orders sql by the best coders in the world

showing results for - "getting customers with no orders sql"
Lachlan
29 Jul 2018
1SELECT DISTINCT I.*, ITO,itemID AS [NULL if never ordered]
2FROM Items As I
3LEFT JOIN
4ItemsInOrder AS ITO
5ON I.itemID=ITO.itemID
6WHERE ITO,itemID IS NULL
Bautista
28 Jul 2016
1SELECT * FROM Items
2WHERE itemID NOT IN
3(SELECT itemID FROM ItemsInOrder)
4