Re: MySQL NOT IN Query not working
| From: | Ligaya Turmelle | Date: | Fri, 17 Mar 2006 01:01:11 +0000 |
| Subject: | Re: MySQL NOT IN Query not working | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-232071@lists.php.net to get a copy of this message | ||
Kevin Murphy wrote:
Anyone want to point me to why this isn't working:
$hr_query = "select dp_lname,dp_fname,dp_id
FROM dir_all
WHERE dp_id NOT IN (SELECT sup_id FROM dir_title2)
ORDER BY dp_lname";
There are two tables, dir_all (the main list of everyone) and dir_title2 (supplemental). If someone is in dir_title2 then the sup_id is the same as their dp_id. What I am trying to do is get a list of every person in dir_all that is NOT in dir_title2. Any thoughts as to what am doing wrong?
What does mysql_error() say?
--
life is a game... so have fun.