ID Car Location
12 Ferrari Earth
13 Porsche House
14 Volvo Jupiter
Now I want to grab the "adminID" from the "AdminTable", but only if it has three customers with the cars "Ferrari", "Porsche" and "Volvo", which it has in my example above...
Ignore the table names and columns, couldn't think of a better example? Sad!
If you want to see some queries that I've come up with? That's not working? Sure!
FROM adminTable as t1
WHERE (t1.customerID = (SELECT ID from customerTable WHERE (car = 'Ferrari')))
(t1.customerID = (SELECT ID from customerTable WHERE (car = 'Porsche')))
(t1.customerID = (SELECT ID from customerTable WHERE (car = 'Volvo')));
This selects the correct ID's and everything... But I now only want to display those who returned "true" on all those "or"-conditions...