Solved

Duplicate lines in a SQL table

Posted on 2013-05-17
2
412 Views
Last Modified: 2013-05-17
Hi

I have a SQL table called Transactions with a field Transaction ID. I want to duplicate lines with a certain TransactionID. What SQL statement would I use to do this?
0
Comment
Question by:murbro
2 Comments
 
LVL 15

Accepted Solution

by:
Aaron Shilo earned 500 total points
ID: 39176744
insert into Transactions
select * from Transactions
where Transactionid = id

OR

insert into Transactions
select * from Transactions
where Transactionid in (id,id,id)
0
 

Author Closing Comment

by:murbro
ID: 39176755
Thanks
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I wrote this interesting script that really help me find jobs or procedures when working in a huge environment. I could I have written it as a Procedure but then I would have to have it on each machine or have a link to a server-related search that …
The Delta outage: 650 cancelled flights, more than 1200 delayed flights, thousands of frustrated customers, tens of millions of dollars in damages – plus untold reputational damage to one of the world’s most trusted airlines. All due to a catastroph…
This video shows, step by step, how to configure Oracle Heterogeneous Services via the Generic Gateway Agent in order to make a connection from an Oracle session and access a remote SQL Server database table.
Viewers will learn how the fundamental information of how to create a table.

809 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question