CELKO (12/14/2012)
[ Yiikes, that's incredibly convoluted. What a royal pita to try to understand, much less change or debug later!!
But it is fast and portable 😀
On a more serious note, that kind of function nesting used to be standard idioms in early SQL. If you can find some articles and books by David Rozenshtein, he did a lot of stuff with it to create the Characteristic function, etc.
Yeah, and we used to use punch cards and write our own bubble sorts too. For me to use something that indecipherable, there'd have to be a noticeable performance diff.
As to "portable", that really is a myth. There are so many custom approaches in each variant of SQL you can never port anything easily.
SQL DBA,SQL Server MVP(07, 08, 09) "It's a dog-eat-dog world, and I'm wearing Milk-Bone underwear." "Norm", on "Cheers". Also from "Cheers", from "Carla": "You need to know 3 things about Tortelli men: Tortelli men draw women like flies; Tortelli men treat women like flies; Tortelli men's brains are in their flies".