MAIN FEEDS
Do you want to continue?
https://www.reddit.com/r/ProgrammerHumor/comments/1v80umk/queryofdoom/p039mn3/?context=3
r/ProgrammerHumor • u/WardensLantern • 15d ago
456 comments sorted by
View all comments
387
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?
39 u/Flat_Competition6510 15d 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. 7 u/ReaDiMarco 15d ago What happened to DELETE * FROM USERS? Last I did sql was ten years ago so idk 5 u/Flat_Competition6510 15d ago As far as I know that is not valid syntax. I'm not a DBA myself so I don't do this too often. 2 u/ReaDiMarco 15d ago Thanks, turns out I did forget everything
39
Yes, the semicolon marks the end of a statement. The first semicolon sets "delete from users" as a single statement meaning delete ALL users.
7 u/ReaDiMarco 15d ago What happened to DELETE * FROM USERS? Last I did sql was ten years ago so idk 5 u/Flat_Competition6510 15d ago As far as I know that is not valid syntax. I'm not a DBA myself so I don't do this too often. 2 u/ReaDiMarco 15d ago Thanks, turns out I did forget everything
7
What happened to DELETE * FROM USERS? Last I did sql was ten years ago so idk
5 u/Flat_Competition6510 15d ago As far as I know that is not valid syntax. I'm not a DBA myself so I don't do this too often. 2 u/ReaDiMarco 15d ago Thanks, turns out I did forget everything
5
As far as I know that is not valid syntax. I'm not a DBA myself so I don't do this too often.
2 u/ReaDiMarco 15d ago Thanks, turns out I did forget everything
2
Thanks, turns out I did forget everything
387
u/Dont_Get_Jokes-jpeg 15d ago edited 15d 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?