That sets the value of the col1 field in every row in tb1 to the value 
retrieved from tb2.  I doubt that's what he wants, but he didn't tell us, so 
maybe it is.

RobR

-----Original Message-----
From: [email protected] [mailto:[email protected]] 
On Behalf Of Igor Tandetnik
Sent: Thursday, August 23, 2012 9:12 AM
To: [email protected]
Subject: Re: [sqlite] to table update

yanhong.ye <[email protected]> wrote:
> update tb1 set col1=(select col1 from tb2 ) where tb1.co2=tb2.co2;

The closing parenthesis is in the wrong place:

update tb1 set col1=(select col1 from tb2 where tb1.co2=tb2.co2);

-- 
Igor Tandetnik

_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users
_______________________________________________
sqlite-users mailing list
[email protected]
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to