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


Win a copy of Soft Skills this week in the Jobs Discussion forum!
JavaRanch » Java Forums » Databases » JDBC
Bookmark "Duplicate values " Watch "Duplicate values " New topic
Author

Duplicate values

Sharadha Sankar
Greenhorn

Joined: Feb 15, 2006
Posts: 20
Hello All,

This is my scenario, lets assume I have the following place table
ID Name address state country.
1 X XYZ ny us
2 A ABC nj us

Now I have to create new IDs 3, 4,5 which has the same values of ID =1.
So I figured I have to select all the value of ID =1 (Select * from place where ID = 1);

and then do a insert.

My question is how do I do the insert?.

Please help

Thanks in advance
Sharadha


Thanks<br />Sharadha
Shailesh Chandra
Ranch Hand

Joined: Aug 13, 2004
Posts: 1081

Originally posted by Sharadha Sankar:

My question is how do I do the insert?.




You have already crossed half way

insert into place (ID ,Name ,address ,state ,country)
(Select 3, Name, address, state, country from place where ID = 1)


If your Id is a char field then dont forget to add single quotes(').

Shailesh


Gravitation cannot be held responsible for people falling in love ~ Albert Einstein
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Duplicate values