SELECT n.uid, n.name from names_tables n LEFT OUTER JOIN exclude ON n.uid = exclude.n_uid WHERE exclude.n_uid IS NULL
> -----Original Message----- > From: Michelle de Beer [mailto:[EMAIL PROTECTED]] > Sent: Wednesday, December 11, 2002 3:22 PM > To: mysql list > Subject: Select Where != > > > I have two tables. One with names and one for > excluding certain names. Exclude-table contains the > uid for the name excluded. > > If I want to see which names has been excluded, this > query does the job: > Select n.uid, n.name from names_tables n, exclude > WHERE n.uid = exclude.n_uid > > But if I want to select all names, but leave out the > ones that are in the "exclude"-table, I thought this > would do it, but no. > Select n.uid, n.name from names_tables n, exclude > WHERE n.uid != exclude.n_uid > > It has something to do with the != thingy... > > Any thoughts? > // Michelle > sql, query > > __________________________________________________ > Do you Yahoo!? > Yahoo! Mail Plus - Powerful. Affordable. Sign up now. http://mailplus.yahoo.com --------------------------------------------------------------------- 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 --------------------------------------------------------------------- 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