Skip site navigation (1) Skip section navigation (2)

Re: UPDATE Multiple Records At Once?

From: lewbloch(at)gmail(dot)com
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: UPDATE Multiple Records At Once?
Date: 2012-04-11 19:20:42
Message-ID: 16939918.22.1334172042328.JavaMail.geo-discussion-forums@pbso10 (view raw or flat)
Thread:
Lists: pgsql-sql
Carlos Mennens wrote:
> I'm trying to update a customer record in a table however I need to
> change several values (cust_address, cust_contact, cust_email). My
> question is how do I properly format this into one single command?
> 
> 
> forza=# SELECT cust_id, cust_name, cust_address, cust_contact, cust_email
> forza-# FROM customers
> forza-# WHERE cust_name = 'iamUNIX'
> forza-# ;
>   cust_id   | cust_name |     cust_address      |  cust_contact  |
> cust_email
> ------------+-----------+-----------------------+----------------+--------------------
>  1000000006 | MobileNX   | 200 South Shore Drive | Carlos Mennens |
> carlos(at)xx**xx(dot)com
> (1 row)
> 
> I did a quick Google search and I can see there is a method or
> procedure which involves parenthesis () however I'm not sure how I
> would change all the values listed above under one command. Can anyone
> please give me a quick example so I can see how this is drawn out via
> ANSI SQL?

<http://www.postgresql.org/docs/9.1/static/sql-update.html>

-- 
Lew

In response to

pgsql-sql by date

Next:From: Edward RossDate: 2012-04-11 20:43:20
Subject: Re: Re: Pregunta acerca de la funciĆ³n COPY de POSTGRES
Previous:From: Carlos MennensDate: 2012-04-11 17:50:25
Subject: UPDATE Multiple Records At Once?

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group