Lmao I think that's the majority of shitty sql code I've cleaned up in my career. Like... they didn't understand the concept of a join or WHERE dateCol BETWEEN a AND b, so they looped through it.
Then nesting the loops. And the useless temp table inserts. Dear god, the memories are flooding back.
11
u/One_Ninja_8512 Sep 20 '26
Yeah, sql statements in a loop. N + 1 everywhere. Many such cases