Robert Poor <rdp...@gmail.com> wrote:
> On Fri, Apr 1, 2011 at 20:13, Igor Tandetnik <itandet...@mvps.org> wrote:
>> Or
>> update table_a set avalue=coalesce(
>> (select bvalue from table_b where akey=bkey), avalue);
> 
> Nice.  But if table_b.value is null, it won't get copied into table_a.
>  That would be a unexpected.

update table_a set avalue = (
    select bvalue from table_b where akey=bkey
    union all
    select avalue);

-- 
Igor Tandetnik


_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to