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 Multiple Record Update 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 "Multiple Record Update" Watch "Multiple Record Update" New topic

Multiple Record Update

Corey McGlone
Ranch Hand

Joined: Dec 20, 2001
Posts: 3271
Quick SQL question for the experts out there...

I'm working on a database that has two tables that I'd like to combine into one. Here's the basic structure:

My goal is to just copy the name column from the UserNames table into the Users table, so that I end up with this:

I've already created the Name column within the Users table, but I'm unsure of how to write the SQL query to copy the names over from UserNames to Users. I want to do something like this:

I just need to know what the correct syntax is.

Thanks, folks.

SCJP Tipline, etc.
Muhammad Saifuddin
Ranch Hand

Joined: Dec 06, 2005
Posts: 1323

The correct syntax is.

[Blog][Linkedin] How To Ask Questions On JavaRanch My OpenSource
Corey McGlone
Ranch Hand

Joined: Dec 20, 2001
Posts: 3271
Originally posted by Saif uddin:
The correct syntax is.

Thank you. Worked like a charm.
I agree. Here's the link:
subject: Multiple Record Update
It's not a secret anymore!