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
Asked
Active
Viewed 62 times
-3
-
is this related to html or sql? – GokulnathP Mar 08 '21 at 05:01
-
where you want to insert? – GokulnathP Mar 08 '21 at 05:02
-
related in sql, in payment table – Roymond Chandra Pradana Mar 08 '21 at 05:27
2 Answers
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";

Priyanka Nigam
- 14
- 5