zlacker

[return to "Pipe Syntax in SQL"]
1. 10000t+Ch[view] [source] 2024-08-24 17:51:52
>>legran+(OP)
The pipeline syntax as presented is nicer than the status quo, but I'd prefer a syntax that models query execution as a directed graph of operations. Doing so would not only make some of the more complex SQL query constructs much more straightforward to represent:

* Joins can be modelled as a "cross-referencing" operation that consume two (or more) data streams and produce a single data stream

* CTEs can be modelled as producing multiple data streams

* Recursive CTEs can be modelled as cycles in the execution graph

◧◩
2. almost+Gp[view] [source] 2024-08-24 18:50:15
>>10000t+Ch
> a directed graph of operations

What syntax do you know that can represent a dag in text?

◧◩◪
3. RyanHa+gC[view] [source] 2024-08-24 20:30:17
>>almost+Gp
A = select * from tbla

B = select * from tblb

C = select * from A join B

◧◩◪◨
4. wtetzn+yF[view] [source] 2024-08-24 20:59:23
>>RyanHa+gC
I guess CTEs already provide that (even if they're a bit clunky).

    WITH a AS (select * from tbla),
    b AS (select * from tblb)
    select * from a join b
[go to top]