|
Posted by Tony Louazι on 10/14/12 11:59
Hi, My SQL lessons are very far :(
CREATE TABLE CONTACTS
(ID INT,
NAME VARCHAR(10)
PHONE VARCHAR(10))
CREATE TABLE CLASS
(CONTACT INT,
CAT INT)
INSERT INTO CONTACTS VALUES (101, 'toto', '3545')
INSERT INTO CONTACTS VALUES (102, 'pif', '8421')
INSERT INTO CONTACTS VALUES (103, 'loulou', '1245')
INSERT INTO CLASS VALUES (101, 1)
INSERT INTO CLASS VALUES (101, 2)
INSERT INTO CLASS VALUES (102, 1)
toto owns to category 1 and 2
pif owns to category 1
loulou owns to none categories
=> how can I display contacts who own to none categories (like loulou) ?
I tried:
SELECT * FROM contacts LEFT OUTER JOIN class ON id = contact
I get the list of all contacts...
but if I add 'WHERE cat = NULL' : there's no result :(
Thanx for your help !
Navigation:
[Reply to this message]
|