File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JDBC and Relational Databases 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
JavaRanch » Java Forums » Databases » JDBC and Relational Databases
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 ]
I agree. Here's the link:
subject: UPDATE multiple columns with subquery
It's not a secret anymore!