11 months ago

One to Many, if 0 "Many", delete the One

Posted 11 months ago by jerauf

How to even describe?

I've got a one-to-many relationship with a table. Table A has a row that relates to many in Table B.

I want to delete a row from Table B and have it check to see if Table A still has any related rows in Table B. If none, delete the related row in Table A.

Is there any way to do this without needing to making a second query to check that there are no more related rows in Table B?

Please sign in or create an account to participate in this conversation.