Search
 
SCRIPT & CODE EXAMPLE
 

SQL

mysql copy table with new name


        
            
        
     CREATE TABLE IF NOT EXISTS new_table LIKE existing_table;

INSERT new_table
SELECT * FROM existing_table;
Comment

mysql copy table to another table

CREATE TABLE new_table 
SELECT col1, col2, col3 
FROM
    existing_table
WHERE
    conditions;
Comment

copy data from one table to another mysql

INSERT INTO table2 (st_id,uid,changed,status,assign_status)
SELECT st_id,from_uid,now(),'Pending','Assigned'
FROM table1
Comment

copy a table mysql

CREATE TABLE employees_clone LIKE employees;
Comment

mysql copy data from one table to another

UPDATE  `Table2`
JOIN `Table1`  ON `Table1`.`a_id` = `Table2`.`id`
SET `Table2`.`txn_stamp` = `Table1`.`tranx_id`
Comment

PREVIOUS NEXT
Code Example
Sql :: SQL Count UNIQUE Rows 
Sql :: copying query result to excel 
Sql :: mysql select tables with name like 
Sql :: update using case in mysql 
Sql :: dateadd in sql 
Sql :: SQL Server rename foreign key constraint 
Sql :: oracle convert int to date 
Sql :: sql cheat sheet pdf 
Sql :: update from table tsql 
Sql :: drop df constraint sql server 
Sql :: trim sql oracle 
Sql :: datediff in sql server 
Sql :: select nextval from sequence oracle 
Sql :: datediff 
Sql :: how to change a collumn name in sql 
Sql :: sql server output parameter 
Sql :: java string to sql timestamp 
Sql :: sql query to get the number of rows in a table 
Sql :: sql calculate working days between two dates excluding weekends and holidays 
Sql :: oracle case 
Sql :: mysql group by range 
Sql :: oracle running queries sql 
Sql :: mysql select true or false 
Sql :: sql #region 
Sql :: sql line numbers 
Sql :: print integer and string in SQL 
Sql :: mysql update column to be nullable 
Sql :: oracle sql concatenate results into string 
Sql :: primary key multiple colums 
Sql :: row to value to json in sql server 
ADD CONTENT
Topic
Content
Source link
Name
6+8 =