| Welcome to WebmasterWorld Guest from 18.104.22.168 |
register, free tools, login, search, pro membership, help, library, announcements, recent posts, open posts,
|Become a Pro Member|
|can I do a join that shows what is 'not' in the other table?|
mysql, query, join
I have two tables connected by 'pid'.
When setting a product up, there is an option to set a tax table. If none is set, the table 'tax' does not get an entry.
Can I use a join to show all pids in 'products' that are not in 'tax', or do I have to build a PHP routine to sift this out?
Yup- LEFT OUTER JOIN is your friend!
FROM Table1 LEFT OUTER JOIN Table2 ON Table1.pid=Table2.pid
WHERE Table2.tax IS NULL
awesome! Thanks so much!
All trademarks and copyrights held by respective owners. Member comments are owned by the poster.
WebmasterWorld is a Developer Shed Community owned by Jim Boykin.
© Webmaster World 1996-2014 all rights reserved