From the documentation (https://www.sqlite.org/lang_update.html)

If a single column-name appears more than once in the list of assignment
expressions, all but the rightmost occurrence is ignored.


On Fri, Apr 12, 2019, 9:00 AM Tony Papadimitriou <to...@acm.org> wrote:

> create table t(s varchar(5));
>
> insert into t values('US'),('USA');
>
> update t set s = replace(s, 'USA', '___'),
>              s = replace(s,'US','USA'),
>              s = replace(s,'___','USA');
>
> select * from t;
>
> -- Expected answer:
> -- USA
> -- USA
> --------------------------------------------------
> -- MySQL gets it right
> -- Postgres prints error about setting the same column multiple times
> -- SQLite3 (latest and older) no changes or wrong result but no
> error/warning
> _______________________________________________
> sqlite-users mailing list
> sqlite-users@mailinglists.sqlite.org
> http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users
>
_______________________________________________
sqlite-users mailing list
sqlite-users@mailinglists.sqlite.org
http://mailinglists.sqlite.org/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to