Re: [sqlite] SQLite Update With CTE

2017-08-22 Thread John McMahon
2:25 To: SQLite Users Subject: [sqlite] SQLite Update With CTE Hi I am rewriting an old Perl script that selectively updates data from one table to another using this statement: UPDATE CUSTOMERS SET cust1= ?, cust2= NULL, street = ?, town = ?, postcode = ?

Re: [sqlite] SQLite Update With CTE

2017-08-22 Thread Keith Medcalf
lot about anticipated traffic volume. >-Original Message- >From: sqlite-users [mailto:sqlite-users- >boun...@mailinglists.sqlite.org] On Behalf Of John McMahon >Sent: Monday, 21 August, 2017 22:25 >To: SQLite Users >Subject: [sqlite] SQLite Update With CTE > >Hi

Re: [sqlite] SQLite Update With CTE

2017-08-22 Thread Clemens Ladisch
John McMahon wrote: > should be > UPDATE CUSTOMERS -- remove 'as c' > SET > cust1= (select customer from test where custnum = CUSTOMERS.custnum), > WHERE custnum IN (SELECT custnum FROM test) Yes. Regards, Clemens ___ sqlite-users mailing list

Re: [sqlite] SQLite Update With CTE

2017-08-22 Thread John McMahon
On 22/08/2017 16:41, Clemens Ladisch wrote: John McMahon wrote: UPDATE CUSTOMERS as c SET cust1= (select customer from test where custnum = c.custnum), cust2= NULL, street = (select address from test where custnum = c.custnum), town = (select town from tes

Re: [sqlite] SQLite Update With CTE

2017-08-21 Thread Clemens Ladisch
John McMahon wrote: > UPDATE CUSTOMERS as c > SET > cust1= (select customer from test where custnum = c.custnum), > cust2= NULL, > street = (select address from test where custnum = c.custnum), > town = (select town from test where custnum = c.custnum), > post

[sqlite] SQLite Update With CTE

2017-08-21 Thread John McMahon
Hi I am rewriting an old Perl script that selectively updates data from one table to another using this statement: UPDATE CUSTOMERS SET cust1= ?, cust2= NULL, street = ?, town = ?, postcode = ? WHERE custnum = ? I am intending to replace it with something li