-3

I have 120 student in 4 class A,B,C,D in student table : Id_student, Name, Class and I have a payment table: Id, Id_student, Class, Payment, Date_payment, Status How i asking how to insert All student in class A with status not_complete

2 Answers2

1
INSERT INTO payment (Id_student, Class, Status)
SELECT Id_student, Class, "not_complete" AS Status
FROM student
WHERE Class = "A";

Refer this link for more information.

GokulnathP
  • 692
  • 3
  • 9
0

insert all into payment values(R1001,'A',"not complete") into payment values(S1002,'B',"not complete") into payment values(T1003,'C',"not complete") into payment values(T1003,'C',"not complete") into payment values(Z1003,'D',"not complete") ............ Update payment set class='A' where class in('B','C','D'); SELECT Id_student, Class, Status FROM payment WHERE Class = "A";