Hi all. I am trying to manual clean up a child table when parent table records are deleted.
DELETE FROM agencyImage WHERE imageID IN
(SELECT images.imageID FROM images LEFT OUTER JOIN agencyImage ON
(images.imageID=agencyImage.imageID) WHERE agencyImage.imageID is null)
This failed because you can't delete from a table that you are looking at. So how do I delete the record from agencyImage table if no record exist in the parent images table?
thanks for the help.
"You cannot escape the responsibility of tomorrow by evading it today." Abraham Lincoln
– Projects (New Mexico Real Estate Listing
– Family Friendly Image Search