Received: from magus.postgresql.org (magus.postgresql.org [87.238.57.229]) by mail.postgresql.org (Postfix) with ESMTP id 03EEDF765A for ; Wed, 11 Apr 2012 16:29:26 -0300 (ADT) Received: from news.hub.org ([200.46.204.72]) by magus.postgresql.org with esmtp (Exim 4.72) (envelope-from ) id 1SI3EJ-0005tP-A4 for pgsql-sql@postgresql.org; Wed, 11 Apr 2012 19:29:25 +0000 Received: from news.hub.org (news.hub.org [200.46.204.72]) by news.hub.org (8.14.4/8.14.4) with ESMTP id q3BJT8R1090691 for ; Wed, 11 Apr 2012 16:29:08 -0300 (ADT) (envelope-from news@news.hub.org) Received: (from news@localhost) by news.hub.org (8.14.4/8.14.4/Submit) id q3BJKhqV084561 for pgsql-sql@postgresql.org; Wed, 11 Apr 2012 16:20:43 -0300 (ADT) (envelope-from news) From: lewbloch@gmail.com X-Newsgroups: pgsql.sql Subject: Re: UPDATE Multiple Records At Once? Date: Wed, 11 Apr 2012 12:20:42 -0700 (PDT) Organization: http://groups.google.com Lines: 27 Message-ID: <16939918.22.1334172042328.JavaMail.geo-discussion-forums@pbso10> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 X-Complaints-To: groups-abuse@google.com In-Reply-To: Complaints-To: groups-abuse@google.com Injection-Info: glegroupsg2000goo.googlegroups.com; posting-host=69.28.149.29; posting-account=CP-lKQoAAAAGtB5diOuGlDQk0jIwmH0T User-Agent: G2/1.0 X-Received-Bytes: 2083 To: pgsql-sql@postgresql.org X-Pg-Spam-Score: -1.0 (-) X-Archive-Number: 201204/29 X-Sequence-Number: 36506 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? -- Lew