【发布时间】:2013-09-29 17:25:42
【问题描述】:
我知道在所有输入数据已知时如何插入,并且我知道在所有数据都依赖于选择时如何插入,但我不知道如何在两者之间进行.我现在在哪里:
INSERT INTO takes (stu_id, "CS-001", 1, "Autumn", 2009, null)
VALUES (SELECT id AS stu_id
FROM student
WHERE dept_name = "Comp. Sci.")
因此我知道除了学生 ID 之外的所有其他输入数据,但是 MySQL 只是给了我一个语法错误。
【问题讨论】:
标签: mysql sql select insert insert-into