The moose likes JDBC and the fly likes Multiple Record Update Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Databases » JDBC
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: 1321

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.
jQuery in Action, 2nd edition
subject: Multiple Record Update
Similar Threads
Can Arrays be treated as DB tables?
Problem in composite key as foreign key mapping w/ hibernate v3.2.6 and jdk-6
MySQL field is autoincrememnt - insert?
Can't use Optimistic Locking
Transposing rows to columns