aspose file tools*
The moose likes JDBC and the fly likes Sample SQL question Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Sample SQL question" Watch "Sample SQL question" New topic
Author

Sample SQL question

Alex gRin
Greenhorn

Joined: Nov 21, 2009
Posts: 3
I have a table that kind of looks like this



And another table that looks like this


What is the right query to take the firstname lastname from table one and insert it to table 2 so that the name matches with id and would look like this


I tried one query before but it does not matches the info

Thanks
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 9317
    
109

What's the question?


[My Blog] [JavaRanch Journal]
Venus Ong
Greenhorn

Joined: Dec 10, 2009
Posts: 7
Hello Alex

I think you may want to explore the Merge function of SQL for this case.

Cheers
Venus
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Sample SQL question
 
Similar Threads
Help needed with ResultSet
That's what I meant by tough EJB-QL
Primary Key Autogeneration for InheritenceType. TABLE_PER_CLASS
Search Query Problem
Display the sequence numbers on the output rows of a select in Oracle 10g