GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   WTH is wrong with this MySql statement? (https://gfy.com/showthread.php?t=667693)

alex79 10-18-2006 10:14 AM

WTH is wrong with this MySql statement?
 
Code:

SELECT id FROM `table1` WHERE id NOT IN ( SELECT id FROM `table2` )
i get an #1064 - You have an error in your SQL syntax near 'SELECT id FROM `table1` error message

FuqALot 10-18-2006 10:28 AM

try `table1` without quotes, and `table2` without quotes too.

and fyi, u need a pretty new mysql version to use query with query.. but first u should try without the quote.

psili 10-18-2006 10:32 AM

You could try:

SELECT id FROM table1 LEFT JOIN table2 WHERE table2.id IS NULL

CaptainHowdy 10-18-2006 10:37 AM

Quote:

Originally Posted by psili (Post 11104052)
You could try:

SELECT id FROM table1 LEFT JOIN table2 WHERE table2.id IS NULL

:thumbsup !!


All times are GMT -7. The time now is 07:21 PM.

Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2026, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc123