MySQL 插入查询数据

以下语法可将查询结果直接插入指定表

语法

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
INSERT INTO pt_project (
	name,
	teachingDate,
	teachingNo,
	description
)
SELECT
	pr.name,
	pr.teachingDate,
	pr.teachingNo,
	pr.description
FROM
	pt_project pr
WHERE
	pr.course_id = '8';