Koren
|
Posted: 10/21/2005, 12:50 PM |
|
In CCS-custom delete (in a record) (TYPE-SQL) I want to implement the following SQL statement (I'm using MySQL 4.0)
I have 4 tables (T1, T2, T3, T4)
T1 - has the object that I would like to delete (across these tables) as the pk (known as object_pk)
T4 - will have one row of info that would correspond to T1's pk (with the field object_pk)
BOTH T2 & T3 has many rows would correspond to T1's pk (with the field object_pk)
I have been trying to create a delete command that would delete all references to T1's pk in all the tables listed above.
I was hoping that it was as easy as:
DELETE FROM T1, T2, T3, T4
WHERE object_pk = 1
But realized quickly that wasn't the way to go. Been trying various join statments but, being the noob that I am, surely have the syntax all messed up.
Any help would be GREAT! thanks!
|
|
|
|