I need to delete a row which has many connections to other table. Let's say I have two Accounts in my users table which I want to merge. So at first I want to change the id of all rows from Account A's id to Account B's id and after that, I want to delete Account B.
Is there a SQL Command to list every row from every table which point to exactly this one row in the users table? Sometimes the foreign_key is called user_id, sometimes create_user_id, and it even might happen that there is no foreign_key. But the latter isn't important.
This would be very helpful. Thank you for your help!
Kind Regards