le*****@kommunicera.umea.se wrote:
Serge Rielau wrote:
[...] SELECT pivotcol, c1 FROM T, LATERAL(VALUES(1, T.c1), (2, T.c2), ...) AS
S(pivotcol, c1)
I think I have seen an explanation of LATERAL vs TABLE but I fail to
find it now. Is the above statement equal to:
SELECT pivotcol, c1 FROM T, TABLE(VALUES(1, T.c1), (2, T.c2), ...) AS
S(pivotcol, c1)
Yes. LATERAL is the SQL Standard keyword.
We added LATERAL as a synonym for TABLE in DB2 V8.2 and in DB2 Viper you
will find that the TABLE keyword has been deemphasized to a foot note:
nested-table-expression:
|-+----------------------------------------+--(fullselect)-|correlation|--|
| (2) |
'-LATERAL--+--------------------------+-'
'-| cont-handler |--WITHIN-'
2. TABLE can be specified in place of LATERAL.
TABLE as a keyword for table functions is not affected by that
(different animal altogether and SQL Standard compliant).
Cheers
Serge
--
Serge Rielau
DB2 Solutions Development
IBM Toronto Lab