Hello,

I have these two tables,

CREATE TABLE `items` (
`name` varchar(100) NOT NULL default '',
`img` varchar(50) NOT NULL default '',
`year` year(4) NOT NULL default '0000',
`item_id` smallint(5) unsigned NOT NULL auto_increment,
PRIMARY KEY (`item_id`)
) TYPE=MyISAM;

CREATE TABLE `units` (
`name` varchar(100) NOT NULL default '',
`item1_id` smallint(5) default NULL,
`item2_id` smallint(6) default NULL,
`item3_id` smallint(5) default NULL,
`item4_id` smallint(5) default NULL,
`item5_id` smallint(5) default NULL,
`unit_id` smallint(5) unsigned NOT NULL auto_increment,
PRIMARY KEY (`unit_id`)
) TYPE=MyISAM;

I'm trying to write a query that will pull all the items from the items table where items.item_id does not appear in units.item1_id and units.item2_id and so on. So far I have not even come close to getting the results I would like.

Thanks in advance for any help,
Mike
sql,mysql


---------------------------------------------------------------------
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

Reply via email to