2015년 11월 23일 월요일

MySql table copy


- When copying the schema of table

CREATE TABLE new_table like old_table;

When copying the data of table

INSERT INTO new_table SELECT * FROM old_table;

When copying the data to another field in another table

INSERT INTO new_table ( c, b )

SELECT a, b FROM old_table ;


original source : http://blog.hints.co.kr/mysql%ED%85%8C%EC%9D%B4%EB%B8%94%EC%9D%B4%EB%A6%84%EB%B3%80%EA%B2%BD-%ED%85%8C%EC%9D%B4%EB%B8%94%EB%B3%B5%EC%82%AC/

댓글 없음 :

댓글 쓰기