It is that time of year again. I need to do obligatory post 🎄
@nixCraft I am stealing this for my Xmas shirt next year.
@nixCraft SQL Clause: syntax error at or near "ORDER"

@nixCraft he's sorting it twice as every one because the default sorting as never hit home in the first try.

Even Santa... even Santa does it

@nixCraft

for(goodness_sake) { be_good(); }

@nixCraft I started out thinking that was a Cake song.

We are now accepting callers
for these beautiful
pendant keychains.

@nixCraft AI Santa knows if you been north or nice

@nixCraft No, Bobby Tables, still no presents for you this year, if you keep up with that sort of behaviour…

Oh, wait, it looks like your record says «behavior = “nice”» after all… I wonder how that happened…? 🤔

@nixCraft SCENE: North Pole Server Room. Some SOFTWARE ELVES are here.

SRE (SITE RELIABILITY ELF): Uhhh, the database server CPU just spiked.
DBA ELF: Someone trying to run last year's delivery reports?
SRE: No. (*sighs deeply*) The Big S is doing a SELECT * again. On the entire contacts DB, which just passed 8 billion this year.

@nixCraft sorting it twice seems redundant. Unless sorting with a 2 part key in a single pass qualifies as 'twice'

@nixCraft

He stored a big list
But his key choice is shite
No indexes so we'll be here all night
NoSQL Claus ain't comin', to town

@nixCraft I winced and wondered if he remembered to encode the contacts table in utf8mb4.

The trauma is real.

@nixCraft

Bobby Tables made it to the top of the naughty list this year with:

;update contacts set address='mine' where behavior='nice';

in his email to Santa

@nixCraft SQL clause is in breach of several GDPR regulations and must respond within 30 days
@nixCraft Oh, yes, it's Halloween, soon!
@nixCraft That's the best nerdgasm I've had in a long time! Thanks for posting.

@nixCraft Come on Santa. Normalise! Have a table where id 1 = 'naughty' and id = 2 'nice' (DEFAULT 'naughty') and do a join.

That way you can add a third category if needed, plus internationalisation becomes easy.

@negative12dollarbill @nixCraft could be a postgres enum! values look like strings but internally aren't.
@nixCraft Where do I buy this sweater?
@nixCraft Recommending that Santa include an ORDER BY “claus”.
@nixCraft I love hearing this one every year! LOL!

@nixCraft

Those little curvy quotes around 'nice' probably won't work.

"You have an error on your SQL syntax WHERE behavior =..."

@nixCraft I always assumed, because he keeps a List, that Santa Claus is using SharePoint.
@nixCraft can also be read in the style of “Going the Distance” by Cake