d0ad381833
* test: add spark query unit test and check grammar * test: add select explain、lateralSubQuery、transform unit test * chore: fileName exchange --------- Co-authored-by: dilu <dilu@dtstack.com>
7 lines
357 B
SQL
7 lines
357 B
SQL
-- PIVOT ( { aggregate_expression [ AS aggregate_expression_alias ] } [ , ... ]
|
|
-- FOR column_list IN ( expression_list ) )
|
|
|
|
SELECT * FROM person PIVOT (SUM(age) AS a, AVG(class) AS c FOR name IN ('John' AS john, 'Mike' AS mike));
|
|
|
|
SELECT * FROM person PIVOT (SUM(age) AS a, AVG(class) AS c FOR (name, age) IN (('John', 30) AS c1, ('Mike', 40) AS c2));
|