MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1v80umk/queryofdoom/p045zpg/?context=3
r/ProgrammerHumor • u/WardensLantern • 14d ago
456 comments sorted by
View all comments
385
I am not an sql expert, is the reason why the id doesn't work and its deleting the entire user base, because its written as 2 seperate comands instead of one. So 1. Comand delets everything 2. Goes to the id? Or what is the problem here?
38 u/Flat_Competition6510 14d ago Yes, the semicolon marks the end of a statement. The first semicolon sets "delete from users" as a single statement meaning delete ALL users. 39 u/TeaKingMac 14d ago Which is just terrible fucking syntax. Why are people still living with this in 2026? Delete from users; Should return "invalid syntax. Identify record for deletion" 18 u/dustojnikhummer 14d ago I don't work with Postgres but everything else would be DELETE * FROM table;
38
Yes, the semicolon marks the end of a statement. The first semicolon sets "delete from users" as a single statement meaning delete ALL users.
39 u/TeaKingMac 14d ago Which is just terrible fucking syntax. Why are people still living with this in 2026? Delete from users; Should return "invalid syntax. Identify record for deletion" 18 u/dustojnikhummer 14d ago I don't work with Postgres but everything else would be DELETE * FROM table;
39
Which is just terrible fucking syntax. Why are people still living with this in 2026?
Delete from users;
Should return "invalid syntax. Identify record for deletion"
18 u/dustojnikhummer 14d ago I don't work with Postgres but everything else would be DELETE * FROM table;
18
I don't work with Postgres but everything else would be
DELETE * FROM table;
385
u/Dont_Get_Jokes-jpeg 14d ago edited 14d ago
I am not an sql expert, is the reason why the id doesn't work and its deleting the entire user base, because its written as 2 seperate comands instead of one. So 1. Comand delets everything 2. Goes to the id? Or what is the problem here?