Solved

Duplicate lines in a SQL table

Posted on 2013-05-17
2
411 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

Suggested Solutions

Title # Comments Views Activity
SQL Login 17 40
Using Aggregate Functions to Count 3 34
Help with Sorting Full Text results 2 14
ORA-00923: FROM keyword not found where expected 3 34
This article explains how to reset the password of the sa account on a Microsoft SQL Server.  The steps in this article work in SQL 2005, 2008, 2008 R2, 2012, 2014 and 2016.
This article shows gives you an overview on SQL Server 2016 row level security. You will also get to know the usages of row-level-security and how it works
Via a live example, show how to extract information from SQL Server on Database, Connection and Server properties
Using examples as well as descriptions, and references to Books Online, show the documentation available for datatypes, explain the available data types and show how data can be passed into and out of variables.

895 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now