r/ProgrammerDadJokes • u/Full_stack1 • Mar 22 '22
A SQL query walks into a bar…
It walks up to two tables and says, “Mind if I join you?”
31
u/hughperman Mar 22 '22
It goes to the bar and orders everything it can get its hands on because it doesn't know its own limits
21
u/existential_issue Mar 22 '22
On one condition…
9
u/chadding Mar 22 '22
Where 1=1
5
u/existential_issue Mar 22 '22
You mean “on 1=1”? Ye Olde Cartesian Product Pub?
4
u/chadding Mar 22 '22
Ah yes, interesting place. Try the duplicate special, just about everyone has been served it on occasion, but almost no one meant to request it.
2
13
u/chadding Mar 22 '22
Without any join conditions all the tables in the bar become one giant Cartesian table which overflows the bar and locks out all the patrons.
9
u/chadding Mar 22 '22
The bartender tries to kill the query but he accidentally dropped his keys and never recovered.
17
7
6
u/SupahCraig Mar 22 '22
Waiter walks up and asks “what are you HAVING?”
3
5
2
98
u/Alex_Sherby Mar 22 '22
WHERE is the bathroom?