True, but SQLite3 is known to provide several conveniences that are not
necessarily standard SQL.
-Original Message-
From: Simon Slavin
Sent: Friday, April 12, 2019 7:11 PM
On 12 Apr 2019, at 5:00pm, Tony Papadimitriou wrote:
update t set s = replace(s, 'USA', '___'),
s
On 12 Apr 2019, at 5:00pm, Tony Papadimitriou wrote:
> update t set s = replace(s, 'USA', '___'),
> s = replace(s,'US','USA'),
> s = replace(s,'___','USA');
To add to the answers other people gave, there's no set order for SQL to
process these changes. The SQL definitio
I know this, thanks. I simply made a test case that can be run in MySQL,
Postgreq and SQLite3.
-Original Message-
From: Chris Locke
create table t(s varchar(5));
Also note that SQLite doesn't 'understand' varchar (it uses text) and it
doesn't limit the entry to 5 characters.
This
> create table t(s varchar(5));
Also note that SQLite doesn't 'understand' varchar (it uses text) and it
doesn't limit the entry to 5 characters.
This doesn't help your issue directly, but does highlight that you've not
read the SQLite documentation, and aren't creating tables properly.
On Fri,
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 wrote:
> create table t(s varchar(5));
>
> insert
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
--
--
6 matches
Mail list logo