Re: Subquery trouble :)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



If your version of mysql is prior to 4.1 subqueries are limited to UPDATE...SELECT and REPLACE...SELECT.

See  http://www.mysql.com/doc/en/ANSI_diff_Sub-selects.html  for help to write your query without using a subquery.

Doug

"Perfection is finally attained not when there is no longer anything to add, but when there is no longer anything to take away." -- Antoine de Saint Exup?ry


On Tue, 13 May 2003 23:01:29 +0200, Andreas Cahen wrote:

>Hi there list readers!
>
>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);
>
>
>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?? :)
>
>
>Cheers,
>
>Andreas Cahen
>
>
>-- 
>PHP Database Mailing List (http://www.php.net/)
>To unsubscribe, visit: http://www.php.net/unsub.php
>



-- 
PHP Database Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php



[Index of Archives]     [PHP Home]     [PHP Users]     [Postgresql Discussion]     [Kernel Newbies]     [Postgresql]     [Yosemite News]

  Powered by Linux