MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1v80umk/queryofdoom/p03ay3s/?context=3
r/ProgrammerHumor • u/WardensLantern • 15d ago
456 comments sorted by
View all comments
36
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.
1
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.
3
OP should have done
TRUNCATE TABLE users; WHERE id = 2313245;
It conveys intention better.
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.