Igor, I am using a temporary table where that condition will not occur but I do appreciate the info as I was considering re-writing the SQL to see if I could do it without using a temporary table and that would have created the NULL condition you noted.
Thanks again for noting the potential problem with the SQL, it has undoubtably saved me considerable time had I tried to re-write the SQL without a temporary table. And yes I did make a typo it should have been TableA.Field1. Also thanks to all who helped me find a solution. Greg ------------------------------ Message: 10 Date: Mon, 23 Feb 2009 20:35:41 -0500 From: "Igor Tandetnik" <[email protected]> Subject: Re: [sqlite] UPDATE Field based on matching value in different Table To: [email protected] Message-ID: <[email protected]> "Greg Robertson" <[email protected]> wrote in message news:[email protected] > That did it. > > Thanks > > Greg > > On Mon, Feb 23, 2009 at 7:05 PM, Griggs, Donald > <[email protected]> wrote: >> Hi Greg, >> >> Someone on the list may give a better reply, and I'm sending this to >> you >> directly, but I think the following will work: >> >> Update tableA >> set Field2 = ( select Field4 from tableB >> where TableA.Field3=TableB.Field4 ); If there are any rows in tableA without a matching row in tableB, this would set Field2 in all such rows to NULL. This may or may not matter in your case, of course. Igor Tandetnik _______________________________________________ sqlite-users mailing list [email protected] http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

