blob: c249329d6a61cf16494fc1a982e6f98c05f24330 (
plain) (
tree)
|
|
-- Automatically generated by SQLQueryTestSuite
-- Number of queries: 4
-- !query 0
CREATE OR REPLACE TEMPORARY VIEW p AS VALUES (1, 1) AS T(pk, pv)
-- !query 0 schema
struct<>
-- !query 0 output
-- !query 1
CREATE OR REPLACE TEMPORARY VIEW c AS VALUES (1, 1) AS T(ck, cv)
-- !query 1 schema
struct<>
-- !query 1 output
-- !query 2
SELECT pk, cv
FROM p, c
WHERE p.pk = c.ck
AND c.cv = (SELECT avg(c1.cv)
FROM c c1
WHERE c1.ck = p.pk)
-- !query 2 schema
struct<pk:int,cv:int>
-- !query 2 output
1 1
-- !query 3
SELECT pk, cv
FROM p, c
WHERE p.pk = c.ck
AND c.cv = (SELECT max(avg)
FROM (SELECT c1.cv, avg(c1.cv) avg
FROM c c1
WHERE c1.ck = p.pk
GROUP BY c1.cv))
-- !query 3 schema
struct<pk:int,cv:int>
-- !query 3 output
1 1
|