Kudos
Collect
Twiiter
Facebook
Share
Develop somethings, meditation, reading and thinking...

MySQL Select 해서 Insert 하기

Last updated over 5 years ago
1 0 0 0

테이블에 값을 그냥 입력하는 방법과 SELECT 해서 그 값을 INSERT 하는 방법이 비슷하면서도 달라 매번 헷갈려 정리.

SELECT 해서 INSERT 하기

INSERT INTO
    target_table_name (column1, column2, ...)
SELECT 
   column1, column2, ... FROM source_table_name;

그냥 INSERT 하기

INSERT INTO
    target_table_name (column1, column2, ...)
VALUES
    (value1, value2, ...);

(MySQL INSERT INTO SELECT)

Hi, my name is Richard. I’m a developer wants to make the world better with logic power. Mainly I use Linux, Nginx, MySQL, PHP and JavaScript . I want to share my knowledge with someone that it was also based from some great persons via LYNMP. 👨‍💻

Essedrop - Make your file online instantly
 

Responses

Leave a response to @richard

Please sign in to comment.
Markdown is also available in comment.