aboutsummaryrefslogtreecommitdiff
path: root/sql/core/src/test/resources/sql-tests/results/having.sql.out
blob: e0923832673cb464ca22520946d9c940665e32c5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
-- Automatically generated by SQLQueryTestSuite
-- Number of queries: 4


-- !query 0
create temporary view hav as select * from values
  ("one", 1),
  ("two", 2),
  ("three", 3),
  ("one", 5)
  as hav(k, v)
-- !query 0 schema
struct<>
-- !query 0 output



-- !query 1
SELECT k, sum(v) FROM hav GROUP BY k HAVING sum(v) > 2
-- !query 1 schema
struct<k:string,sum(v):bigint>
-- !query 1 output
one	6
three	3


-- !query 2
SELECT count(k) FROM hav GROUP BY v + 1 HAVING v + 1 = 2
-- !query 2 schema
struct<count(k):bigint>
-- !query 2 output
1


-- !query 3
SELECT MIN(t.v) FROM (SELECT * FROM hav WHERE v > 0) t HAVING(COUNT(1) > 0)
-- !query 3 schema
struct<min(v):int>
-- !query 3 output
1