Hi gang Need to get all items that are not in id supplied For example select * from test where id!=2 will do this but it will also return values that are in 2 if they are also in another id!=2 In my example if I used the above query I would get 10,11,12,13,14,17,18,19,20,17,21,22,23
I would not want the 10 or the 17 (x2) as they are also in id2! HELP!!!!!!!!!!!!!!!!!!!!!!!!! I am using mysql 3.23.39 Thanks in advance Scott DROP TABLE IF EXISTS test; CREATE TABLE `test` ( `id` TINYINT( 6 ) DEFAULT '0' NOT NULL , `item` TINYINT( 6 ) DEFAULT '0' NOT NULL , PRIMARY KEY ( `id` , `item` ) ); INSERT INTO test VALUES (1, 10); INSERT INTO test VALUES (1, 11); INSERT INTO test VALUES (1, 12); INSERT INTO test VALUES (1, 13); INSERT INTO test VALUES (1, 14); INSERT INTO test VALUES (2, 10); INSERT INTO test VALUES (2, 15); INSERT INTO test VALUES (2, 16); INSERT INTO test VALUES (2, 17); INSERT INTO test VALUES (3, 17); INSERT INTO test VALUES (3, 18); INSERT INTO test VALUES (3, 19); INSERT INTO test VALUES (3, 20); INSERT INTO test VALUES (4, 17); INSERT INTO test VALUES (4, 21); INSERT INTO test VALUES (4, 22); INSERT INTO test VALUES (4, 23); --------------------------------------------------------------------- Before posting, please check: http://www.mysql.com/manual.php (the manual) http://lists.mysql.com/ (the list archive) To request this thread, e-mail <[EMAIL PROTECTED]> To unsubscribe, e-mail <[EMAIL PROTECTED]> Trouble unsubscribing? Try: http://lists.mysql.com/php/unsubscribe.php