4 ms·
Completely agree. For example, why isn't there functionality to define aliases for complex expressions and then reuse those through a query. Simple query-local
by nicoburns 6y ago
Completely agree. For example, why isn't there functionality to define aliases for complex expressions and then reuse those through a query. Simple query-local SQL functions would be nice too.
I'd love to see a "SQL-like" language that compiles down to SQL itself, much like Babel or TypeScript in the JavaScript world. I think the tricky thing is that there is no single SQL target.
- pkalinowski 6y ago> Completely agree. For example, why isn't there functionality to define aliases for complex expressions and then reuse those through a query. Simple query-local SQL functions would be nice too. What about common table expressions? Or custom defined functions? with X as ( select... ) It's widely used for analysis
- jeltz 6y agoCTEs can do that, but it is quite clunky for when you just want to reuse a partial per row computation.
- quickthrower2 6y agoMulti sql targets means it’s even more of an advantage to compile
- jimbokun 6y ago> I think the tricky thing is that there is no single SQL target. So the jquery of SQL, then.
- scarface74 6y agoLinq
- parliament32 6y ago>functionality to define aliases for complex expressions and then reuse those through a query What's an example of what you're trying to do? I think views, user-defined functions, routines, and select aliases would cover all the bases...