๋ณธ๋ฌธ ๋ฐ”๋กœ๊ฐ€๊ธฐ

๋ชฉ๋ก์ด ์—†์Šต๋‹ˆ๋‹ค.

[MySQL] ํ…Œ์ด๋ธ” ๋ณต์‚ฌ

๐Ÿ›ข DB/MySQL

    ํ…Œ์ด๋ธ” ๊ตฌ์กฐ๋งŒ ๋ณต์‚ฌ

    CREATE TABLE NEW_TABLE_NAME LIKE OLD_TABLE_NAME;

     

    ํ…Œ์ด๋ธ” ๋ฐ์ดํ„ฐ๋งŒ ๋ณต์‚ฌ

    INSERT INTO DESTINATION_TABLE_NAME (SELECT * FROM SOURCE_TABLE_NAME);

     

    ํ…Œ์ด๋ธ” ๊ตฌ์กฐ ๋ฐ ๋ฐ์ดํ„ฐ ๋ณต์‚ฌ

    CREATE TABLE NEW_TABLE_NAME (SELECT * FROM OLD_TABLE_NAME);