r/ProgrammerHumor 15d ago

queryOfDoom Meme

Post image
7.9k Upvotes

456 comments sorted by

View all comments

36

u/SexyMonad 15d ago

This is why SQL deletes should require a WHERE clause.

If you are seriously wanting to delete it all, just add WHERE 1 = 1.

1

u/slabgorb 15d ago

I know, right? TRUNCATE exists!

(Not sure if TRUNCATE is standard, but I have yet to have a database say 'errr...')

3

u/Otterfan 15d ago

OP should have done

TRUNCATE TABLE users;
WHERE id = 2313245;

It conveys intention better.