At the end (outside the subquery), add:

WHERE Field1 IN (SELECT Field1 FROM Table2)

- Jeff

-----Original Message-----
From: RB Smissaert [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 31, 2008 3:15 PM
To: sqlite-users@sqlite.org
Subject: [sqlite] how to do this case when?

How do I alter this SQL, so that the original field remains the same
when there is no match? A case when else end should do it, but I can't
get it right.

UPDATE Table1 SET Field1 =
        (SELECT Field2 FROM Table2
        WHERE Table1.Field1 = Table2.Field1)

Thanks for any advice.

RBS



------------------------------------------------------------------------
-----
To unsubscribe, send email to [EMAIL PROTECTED]
------------------------------------------------------------------------
-----


-----------------------------------------------------------------------------
To unsubscribe, send email to [EMAIL PROTECTED]
-----------------------------------------------------------------------------

Reply via email to