Re: Subquery trouble :)
| From: | Maxim Maletsky | Date: | Tue, 13 May 2003 21:28:20 +0000 |
| Subject: | Re: Subquery trouble :) | ||
| References: | 1 | Groups: | php.db |
| Request: | Send a blank email to php-db+get-27723@lists.php.net to get a copy of this message | ||
On Tue, 13 May 2003 23:01:29 +0200
"Andreas Cahen" <qube@space.ch> wrote:
> Hi there list readers!
and wroiters too
> I need some hints on an update statement I want to use for my database
> and after trying for a while I decided to ask you guys..
> This is the troublemaker:
>
>
> UPDATE details_domains_a SET town_id = 910 WHERE Domain IN (SELECT
> domain FROM domains_a WHERE town_id = 910);
3 questions:
1. what DB is it for? Looks like Oralce to me :)
2. What sense can it make updating town_id to 910 on any row that
already contains it?
3. what is this 'Domain'? That could actually be your syntax error.
>
> The error I get:
>
> You have an error in your SQL syntax near 'SELECT domain
> FROM domains_a
> WHERE town_id = 910 )' at line 1
>
>
> The subquery itself, SELECT domain FROM domains_a WHERE town_id = 910,
> works fine..
> Any advises, hints or clues?? :)
Once again, depends on DB.
--
Maxim Maletsky
maxim@php.net