StatoFatt = 'Chiusa'
WHERE
NumFatt = '23/12'
;
COMMIT;
-Ursprüngliche Nachricht-
Von: Leonardodavinci [mailto:alessan...@system-ini.it]
Gesendet: Donnerstag, 27. Dezember 2012 16:57
An: sqlite-users@sqlite.org
Betreff: Re: [sqlite] Update with two tables
hi i.m new user
hi i.m new user with sqlite and now i have this problem with update function:
with mysql run this script:
UPDATE
TabAgeFattProdutt
INNER JOIN
TabTestaFattAG
ON
TabAgeFattProdutt.NumFattAG = TabTestaFattAG.NumFatt
SET
TabAgeFattProdutt.Stato ='I',
TabTestaFattAG.StatoFatt = 'Chiusa'
WHERE
Unit 5 wrote:
--- Jim Dodgen <[EMAIL PROTECTED]> wrote:
this should work.
UPDATE T1
SET T1.colA = (select T2.colA from T2 where T1.colC
= T2.colC),
T1.colB = (select T2.colB from T2 where T1.colC
= T2.colC)
WHERE EXISTS (select * from T2 where T1.colC =
T2.colC);
Jim,
Thanks for your
You could also try this. I imagine it has to do much less internal querying
to get the job done. This does assume you have a single column PK, beyond
the rowid, that would not change when the other columns changes.
INSERT OR REPLACE INTO T1 SELECT * FROM T2;
DELETE FROM T1 WHERE pk NOT IN
this should work.
UPDATE T1
SET T1.colA = (select T2.colA from T2 where T1.colC = T2.colC),
T1.colB = (select T2.colB from T2 where T1.colC = T2.colC)
WHERE EXISTS (select * from T2 where T1.colC = T2.colC);
Unit 5 wrote:
Hello,
I am trying to update values of some columns in a
table
Hello,
I am trying to update values of some columns in a
table with fresh data from another table. The two
tables have the same column definitions. Is this
possible? Even better would be if the two tables
could be the same; then I could use table aliases in
the update statement.
Here is what
6 matches
Mail list logo