Jump to content

Select from where not in multiple fields


petenaylor

Recommended Posts

Hi all

 

I need to write a mySQL query that selects all from one table where there is not the instance in more than one field in another table.

 

The query I have so far is:

 

mysql_query (" SELECT * FROM text_positions where position not in (select logo_position from shop_basket ) ORDER BY position ASC ") or die (mysql_error());

 

Which works great, but the position could also be in the text_position on the shop_basket table.

 

How can I add this into my query? There is 5 possible field I need to check in the shop_basket table.

 

Many thanks

 

Pete

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.