It's not a secret anymore!*
The moose likes JDBC and the fly likes UPDATE multiple columns with subquery Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "UPDATE multiple columns with subquery" Watch "UPDATE multiple columns with subquery" New topic

UPDATE multiple columns with subquery

Justin Chu
Ranch Hand

Joined: Apr 19, 2002
Posts: 209
Suppose I've two tables CUSTOMERHOMEADDRESS and CUSTOMERWORKADDRESS with similar columns.

How do I write one update statement to copy 5-8 columns from CUSTOMERWORKADDRESS into CUSTOMERHOMEADDRESS?

I'd imagine it will take repeated subquery to achieve this:

[ March 06, 2007: Message edited by: Chu Tan ]
Don't get me started about those stupid light bulbs.
subject: UPDATE multiple columns with subquery
Similar Threads
XML insert in Oracle
Copying data from 1 column of a table to another
problem in updating tables through hibernate
Repeatable SQL
Statement is closed?