Hi,
Is there a batch/bulk UPDATE query syntax available in PostgreSQL, similar
to multirow VALUES syntax available for INSERT?
INSERT Multirow VALUES syntax example:
INSERT INTO films (code, title, did, date_prod, kind) VALUES
('B6717', 'Tampopo', 110, '1985-02-10', 'Comedy'),
('HG120', '
Gnanakumar, 03.02.2011 13:00:
Is there a batch/bulk UPDATE query syntax available in PostgreSQL, similar
to multirow VALUES syntax available for INSERT?
INSERT Multirow VALUES syntax example:
INSERT INTO films (code, title, did, date_prod, kind) VALUES
('B6717', 'Tampopo', 110, '1985-02-10'
Show us explain analyze for this update.
2011/2/3, Gnanakumar :
> Hi,
>
> Is there a batch/bulk UPDATE query syntax available in PostgreSQL, similar
> to multirow VALUES syntax available for INSERT?
>
> INSERT Multirow VALUES syntax example:
> INSERT INTO films (code, title, did, date_prod, kind)
Cond: (companyid = 999::numeric)
Total runtime: 31.319 ms
-Original Message-
From: pasman pasmanski [mailto:pasma...@gmail.com]
Sent: Friday, February 04, 2011 2:01 AM
To: gna...@zoniac.com
Cc: pgsql-admin@postgresql.org
Subject: Re: [ADMIN] Is there a batch/bulk UPDATE syntax available?
Show
create table tmp
(
id serial not null primary key,
name text,
age integer
);
insert into tmp (name,age) values ('keith', 43),('leslie', 40),('bexley',
19),('casey', 6);
update tmp
set age = data_table.age
from
(
select 'keith'::text as name, 44::integer as age
union
select 'leslie', 5