Is it possible to run a delete query without actually deleting the rows? Like just have MySQL tell me which rows were to be deleted if I ran it.
Of course I can run a select with the same where clause to see which rows will be deleted, but I want to ensure the delete query matches.
mysql psuedo delete
Moderator: General Moderators
mysql psuedo delete
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.
- John Cartwright
- Site Admin
- Posts: 11470
- Joined: Tue Dec 23, 2003 2:10 am
- Location: Toronto
- Contact:
Re: mysql psuedo delete
You could write your own transaction script that temporarily stores the results in memory, delete the results, make sure they match, if not restore the results from memory.

- Kieran Huggins
- DevNet Master
- Posts: 3635
- Joined: Wed Dec 06, 2006 4:14 pm
- Location: Toronto, Canada
- Contact:
Re: mysql psuedo delete
just do a "SELECT id FROM" instead of a "DELETE FROM"
optionally, you could use a transaction and roll it back, though I'm not sure that would tell you WHICH rows are deleted.
optionally, you could use a transaction and roll it back, though I'm not sure that would tell you WHICH rows are deleted.
- aceconcepts
- DevNet Resident
- Posts: 1424
- Joined: Mon Feb 06, 2006 11:26 am
- Location: London
Re: mysql psuedo delete
Can't remember exactly how I used it but I have used "ON DELETE" in the past - thought it might be worth looking into.
Forgive me if it's got nothing to do with it
Forgive me if it's got nothing to do with it
Re: mysql psuedo delete
LOL thanks for the crazy emoticon. That was funny LOLJcart wrote:You could write your own transaction script that temporarily stores the results in memory, delete the results, make sure they match, if not restore the results from memory.
It does seem a bit crazy actually.
But I am dealing with a large (about 1.5M rows) table, and that kinda makes me feel
Set Search Time - A google chrome extension. When you search only results from the past year (or set time period) are displayed. Helps tremendously when using new technologies to avoid outdated results.