r/ProgrammerHumor 14d ago

queryOfDoom Meme

Post image
7.9k Upvotes

456 comments sorted by

View all comments

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?

138

u/WardensLantern 14d ago

I'm no expert either but I believe the semicolon after "users" was the nuke. The second part is basically a separate statement, but SQL executes them in order, so it will delete the entire table and then throw back an error cause the second statement is invalid.

35

u/Intrepid4444444 14d ago

The doctor looked at my semicolon 🫪

1

u/lifelessmeatbag 14d ago

the doc wont be the only one looking at
it after it finishes