[prev in list] [next in list] [prev in thread] [next in thread]
List: mysql
Subject: Re: update synopsis error
From: Michael Kruckenberg <michael.kruckenberg () tufts ! edu>
Date: 2004-05-31 21:33:25
Message-ID: 40BBA4A5.1090701 () tufts ! edu
[Download RAW message or body]
What version of MySQL are you using? Subqueries aren't available until
4.1.x.
saiph wrote:
>
> hi,
>
> mysql> update table1
> set c = (select c2 from table2 where c2 = 'value')
> where id = 123;
>
> give me an ERROR 1064.
>
>
> i.e.
>
> create table t1 ( id int primary key, name varchar(20) );
> create table t2 ( id int primary key, name varchar(20) );
>
> insert into t1 values(1, 'not right')
> insert into t2 values(1, 'right')
>
> update t1 set name = (select name from t2 where id = 1) where id = 1;
>
> how i can update right?
--
http://mike.kruckenberg.com | michael@kruckenberg.com
--
MySQL General Mailing List
For list archives: http://lists.mysql.com/mysql
To unsubscribe: http://lists.mysql.com/mysql?unsub=mysql@progressive-comp.com
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic