我在学生表中有 4 个 A、B、C、D 类的 120 名学生:Id_student、Name、Class 我有一个付款表:Id、Id_student、Class、Payment、Date_payment、Status 我如何询问如何将所有学生插入状态为 not_complete 的 A 类
问问题
42 次
2 回答
1
INSERT INTO payment (Id_student, Class, Status)
SELECT Id_student, Class, "not_complete" AS Status
FROM student
WHERE Class = "A";
有关更多信息,请参阅此链接。
于 2021-03-08T05:36:52.800 回答
0
将全部插入支付值(R1001,'A',"未完成") 插入支付值(S1002,'B',"未完成") 插入支付值(T1003,'C',"未完成") 插入支付值(T1003,'C',"not complete") 转换成支付值(Z1003,'D',"not complete")............更新支付集class='A' where class in ('B','C','D'); SELECT Id_student, Class, Status FROM payment WHERE Class = "A";
于 2021-03-08T05:54:06.597 回答