News for hackers. Stuff that matters.
Re:We Can Do Better Than SQL by nicoburns on Tuesday August 11, 2020 @06:18AM (#24118866)
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.

Re:We Can Do Better Than SQL by pkalinowski on Tuesday August 11, 2020 @06:41AM (#24118986)
> 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
Re:We Can Do Better Than SQL by jeltz on Tuesday August 11, 2020 @07:39AM (#24119278)
CTEs can do that, but it is quite clunky for when you just want to reuse a partial per row computation.
Re:We Can Do Better Than SQL by parliament32 on Wednesday August 12, 2020 @01:18PM (#24134322)
>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...

Re:We Can Do Better Than SQL by jimbokun on Tuesday August 11, 2020 @09:03AM (#24119845)
> I think the tricky thing is that there is no single SQL target.

So the jquery of SQL, then.

Re:We Can Do Better Than SQL by quickthrower2 on Tuesday August 11, 2020 @06:51AM (#24119041)
Multi sql targets means it’s even more of an advantage to compile
Re:We Can Do Better Than SQL by scarface74 on Wednesday August 12, 2020 @11:24AM (#24132969)
Linq