List:General Discussion« Previous MessageNext Message »
From:Peter Lauri Date:July 26 2006 5:53pm
Subject:RE: JOIN table where not in other table
View as plain text  
I tried that, but that generates:

#1064 - You have an error in your SQL syntax.  Check the manual that
corresponds to your MySQL server version for the right syntax to use near
'SELECT id FROM table2)
LIMIT 0, 100' at line 1

Maybe it is a Version issue? What version of MySQL do support sub queries?

/Peter


-----Original Message-----
From: Chris White [mailto:chriswhite@stripped] 
Sent: Thursday, July 27, 2006 5:37 AM
To: mysql@stripped
Subject: Re: JOIN table where not in other table

On Wednesday 26 July 2006 10:31 am, Peter Lauri wrote:
> Best group member,
>
> I just made up this query, but let us work from this:
>
> SELECT * FROM table1
> LEFT OUTER JOIN table2 ON (table1.id=table2.id)
> WHERE table2.prop IS NULL;

If I understand correct:

SELECT * FROM table 1
WHERE id NOT IN
(SELECT id FROM table2);

-- 
Chris White
PHP Programmer/DBacardi
Interfuel

-- 
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe:    http://lists.mysql.com/mysql?unsub=1

Thread
JOIN table where not in other tablePeter Lauri27 Jul
  • Re: JOIN table where not in other tableChris White27 Jul
    • RE: JOIN table where not in other tablePeter Lauri27 Jul
      • Re: JOIN table where not in other tableChris White27 Jul
        • RE: JOIN table where not in other tablePeter Lauri27 Jul
          • Re: JOIN table where not in other tableChris White27 Jul
            • RE: JOIN table where not in other tablePeter Lauri27 Jul
              • Re: JOIN table where not in other tableChris White27 Jul
                • RE: JOIN table where not in other tablePeter Lauri27 Jul
              • Re: JOIN table where not in other tablePeter Brawley27 Jul