Forum Moderators: coopster

Message Too Old, No Replies

code to delete

         

ferhanz

10:25 am on Jul 30, 2005 (gmt 0)

10+ Year Member




Table name: Subjects
subject_id
student_id (foreign key)
subject_name

i want to delete all subjects by the student where the student_id is x

wht would be the code to delete in tables having relationship

ymasood

10:38 am on Jul 30, 2005 (gmt 0)

10+ Year Member



Ferhanz,

This should do the job:

DELETE FROM Subjects WHERE student_id = x

For other tables simply replace Subjects with the other table name.

Rgds,

YM