Pinned toot

Heute um die Zeit draußen nicht kühler als drinnen. Nix mit Lüften. :blobmegasweats:

hotkey - wenn man seinen Haustürschlüssel im Auto liegen läßt

Kein Weltraum links am Gerät? Kein Problem dieses Buch die Lösung:

This be book bad translation, video games! - Fangamer
fangamer.com/products/this-be-

Miste gerade einen Schrank auf der Arbeit aus.

Wirklich wegschmeißen? Ist immerhin eine Version MIT USB UNTERSTÜTZUNG

Vor ich glaube einem Jahr had Budni sein Dach neu teeren lassen.

Wenn da die Sonne draufbrezelt riecht es in meiner Wohnung immer noch nach Teer ):

Gerade auf geschaut. Könnte mir evtl. gefallen? Und sind in paar Wochen im ?

hmmm!

Hälfte des Nagels ist mir übrigens heute ausgefallen

Sam and Frodo: "Gandalf, is that a bee?"
Gandalf: "Fly, you fools"

...
It actually was a balrog.

Of course that question then results in the idea that one SELECT had duplicates, the other one had some as well, and by UNIONizing them those were dropped.

But they weren't. I had tried. The UNIONized SELECTs gave the right number of results. Only the PIVOT dropped them.

So an hour later I'm back to the explanation that feels counter-intuitive.

Also it's Saturday and I need exclusively at work!

So just now I got sidetracked into asking myself "Wait, does UNION remove results from one SELECT that also occur in the other? Or does it remove duplicates within one SELECT as well?"

I guess the proper answer to this is, when using UNION on two SELECTs the resultset has distinct values.

I was flabbergasted, but eventually found out that UNION "removes duplicates", so I changed it to UNION ALL (which doesn't) and got the right number.

That solution felt and still feels counter-intuitive in my mind. The PIVOT removes the "state" from each result so some might become duplicates of each other. But surely the PIVOT happens *after* the UNION right? After all, executing the two SELECTs without the PIVOT got the right number of results.

... I think I just nerd sniped myself.

A few days ago I wrote some at work. I needed to know the number of things per state. Sounds like a PIVOT, the only problem was that I couldn't find the two states I wanted in one SELECT statement. So I used two and UNIONized them. The number of results in the UNIONized SELECTs looked about right, but when PIVOTed (using COUNT) them the sums of the things didn't add up to the same number!

Show more
mastodon.cloud

Generalistic and moderated instance.