SQLite Forum

Updating a value with one from another table?
Login
Both queries work, but the first one is a lot slower:

<code>UPDATE t1 SET zip=(SELECT t2.ZIP FROM t2 WHERE t2.CODE_STAT=t1.CODE_STAT);

UPDATE t1 set zip=null;

UPDATE t1 SET zip=t2.zip FROM t2 WHERE t2.CODE_STAT=t1.CODE_STAT;</code>