mardi 4 août 2015

Delete a record if its ID does not exist in another table

I have a table called patients with a field id

I have another table info with the field patient_id and other fields.

patient_id is the id from the patients table.

I want to be able to delete a patient but only if it does not exist in info table.

Can anybody give me the sql query for this? I've been trying to figure it out now for a while.



via Chebli Mohamed

Aucun commentaire:

Enregistrer un commentaire