3
Well I have a BD with some records. And I would like that amount of records to duplicate. I don’t want to double loop to show the double amount, I would literally duplicate all the records in the table. Is there any way to accomplish this?
3
Well I have a BD with some records. And I would like that amount of records to duplicate. I don’t want to double loop to show the double amount, I would literally duplicate all the records in the table. Is there any way to accomplish this?
6
Friend makes an Insert and in Voce values makes a select, thus:
INSERT INTO [Database].[dbo].[Table]
([Coluna1]
,[Coluna2])
select Coluna1, Coluna2 from Table
GO
This will duplicate your table as it will insert everything that already exists in your table.
I hope it helps. []’s
6
Use a insert
along with a select
, the types of data in the select
and in the insert
should be the same or compatible it is also possible to use other clauses as where
, join
etc.
INSERT INTO tabela(c1, c2, c3) SELECT c1, c2, c3 FROM tabela
Browser other questions tagged mysql database
You are not signed in. Login or sign up in order to post.
Should be placed in place of C1 of SELECT, the value Null if, only if, C1 is the primary key of the bank, otherwise there will be an error when trying to duplicate id.
– Alanderson