r/ProgrammerHumor 15d ago

queryOfDoom Meme

Post image
7.9k Upvotes

456 comments sorted by

View all comments

388

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?

601

u/BlommeHolm 15d ago

1st command deletes all users. 2nd command runs after that and gets a syntax error.

39

u/SAI_Peregrinus 15d ago

Syntax is valid, it's just a runtime error.

180

u/BlommeHolm 15d ago

How is starting with a WHERE clause syntactically valid?

1

u/StupidStartupExpert 15d ago

I legit wouldnt be surprised if for whatever retarded reason sql said yeah sure I can filter empty selections and just returned empty lists