
April 11th, 2012, 02:04 PM
|
|
Contributing User
|
|
Join Date: Aug 2011
Posts: 51
Time spent in forums: 10 h 8 m 48 sec
Reputation Power: 2
|
|
|
UPDATE Multiple Values From One Column
This is very basic for mostly everyone browsing this forum however I'm stuck and Google isn't giving me what I need and/or I can't seem to use the correct terminology to locate my answer. What I'm trying to do is update a single customer record from a table called 'customers'. They've moved and also changed their staff. I've been tasked to update the records :shocked: in the table to make sure we have their most up to date info. As it stands, their info is as follows:
Code:
forta=# SELECT cust_id, cust_name, cust_address, cust_contact, cust_email
forza-# FROM customers
forza-# WHERE cust_name LIKE 'Owl City'
forza-# ;
cust_id | cust_name | cust_address | cust_contact | cust_email
------------+-----------+----------------------+--------------+-------------------
1000000010 | Owl City | 7991 Maitland Avenue | Perry Gold | perry@owlcity.org
(1 row)
Can someone please help me understand what the UPDATE command would look like if I needed to change the values for (cust_address, cust_contact, cust_email) rather than running the update command three times with different values?
Code:
UPDATE customers SET (cust_address, cust_contact, cust_email) VALUES ('1119 Orange Avenue', 'Jennifer Gold', 'jennifer@owlcity.org') WHERE cust_name = 'Owl City';
ERROR: syntax error at or near "VALUES"
LINE 1: ...mers SET (cust_address, cust_contact, cust_email) VALUES ('1...
|