Re: JOIN in embedded query
| From: | David Robley | Date: | Fri, 09 Aug 2002 05:54:46 +0000 |
| Subject: | Re: JOIN in embedded query | ||
| References: | 1 2 3 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-21073@lists.php.net to get a copy of this message | ||
In article <20020808145718.26060.qmail@pb1.pair.com>, info@rostoplasc.com
says...
> "David Robley" <robleyd@paradise.net.nz> wrote in message
> news:MPG.17bcd9a24f85b5c6989772@news.php.net...
> > In article <20020802150555.50338.qmail@pb1.pair.com>, info@rostoplasc.com
> > says...
> > > UPDATE Emails SET Sent = 'T' WHERE ID = (SELECT Emails.ID FROM Emails
> RIGHT
> > > JOIN KeyWords ON Emails.ID = KeyWords.EmailsID) LIMIT 250
> > >
> > > I am getting an error, and I am quite certain that it is my syntax
> >
> > Can you post the error?
> >
> You have an error in your SQL syntax near 'SELECT Emails.ID FROM Emails
> RIGHT JOIN KeyWords ON Emails.ID = KeyWords.EmailsI' at line 1
>
Indicates that the error is immediately to the left of the text given in
the error string. Which triggers my memory - from the mysql docs - this is
for ver 4, check the docs for a way of imitating sub-selects if your db
doesn't support them:
SELECT * FROM table1 WHERE id IN (SELECT id FROM table2);
You have = instead of IN
Cheers
--
David Robley
Temporary Kiwi!
Quod subigo farinam