From: lewbloch@gmail.com
To: pgsql-sql@postgresql.org
Subject: Re: UPDATE Multiple Records At Once?
Date: Wed, 11 Apr 2012 12:20:42 -0700 (PDT)
Message-ID: <16939918.22.1334172042328.JavaMail.geo-discussion-forums@pbso10> (raw)
In-Reply-To: <CAAQLLO5HwMETX31_jpT2U=HtoqW1gGkc8+qAE5xUMOmGAQTT4g@mail.gmail.com>
References: <CAAQLLO5HwMETX31_jpT2U=HtoqW1gGkc8+qAE5xUMOmGAQTT4g@mail.gmail.com>
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@xx**xx.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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: lewbloch@gmail.com
Subject: Re: UPDATE Multiple Records At Once?
In-Reply-To: <16939918.22.1334172042328.JavaMail.geo-discussion-forums@pbso10>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox