Search
 
SCRIPT & CODE EXAMPLE
 

SQL

mysql copy row with new id

CREATE TEMPORARY TABLE tmp SELECT * FROM sitelog WHERE 1=1;
ALTER TABLE tmp DROP COLUMN `ID`;
INSERT INTO sitelog SELECT 0, tmp.* FROM tmp;
DROP TEMPORARY TABLE tmp;
Comment

MySQL copy row with *

CREATE TEMPORARY TABLE tmp SELECT * from invoices WHERE ...;
    ALTER TABLE tmp drop ID; # drop autoincrement field
    # UPDATE tmp SET ...; # just needed to change other unique keys
    INSERT INTO invoices SELECT 0,tmp.* FROM tmp;
    DROP TABLE tmp;
Comment

PREVIOUS NEXT
Code Example
Sql :: SQL Copy Records Matching a Condition 
Sql :: update values in select statement sql 
Sql :: psql 
Sql :: downlaod database mysql workbench 
Sql :: ! Wildcard in SQL 
Sql :: mysql start of today 
Sql :: sqlalchemy sequence postgresql 
Sql :: sql count and addition by day 
Sql :: sql joins explained 
Sql :: union in sql 
Sql :: subquery in Insert 
Sql :: create database ms sql server 
Sql :: what is sql clause 
Sql :: psotgres multiple values 
Sql :: backup table mssql 
Sql :: why do we need data structure in sql 
Sql :: sql query by rahuldev 
Sql :: mysql listing get a particu particular user firsdt 
Csharp :: lockstate untiy 
Csharp :: wpf round button 
Csharp :: how to detect a mouse click in unity 
Csharp :: asp.net core multiple get methods 
Csharp :: c# remove last character from string 
Csharp :: unity mirror get ip address 
Csharp :: enable script unity 
Csharp :: get scene name unity 
Csharp :: c# how to check string is number 
Csharp :: convert int to double c# 
Csharp :: sconvert string to title case + C3 
Csharp :: how to input a double in c# 
ADD CONTENT
Topic
Content
Source link
Name
9+7 =