]> granicus.if.org Git - postgresql/blob - src/test/regress/expected/select_distinct_on.out
Teach the system how to use hashing for UNION. (INTERSECT/EXCEPT will follow,
[postgresql] / src / test / regress / expected / select_distinct_on.out
1 --
2 -- SELECT_DISTINCT_ON
3 --
4 SELECT DISTINCT ON (string4) string4, two, ten
5    FROM tmp
6    ORDER BY string4 using <, two using >, ten using <;
7  string4 | two | ten 
8 ---------+-----+-----
9  AAAAxx  |   1 |   1
10  HHHHxx  |   1 |   1
11  OOOOxx  |   1 |   1
12  VVVVxx  |   1 |   1
13 (4 rows)
14
15 -- this will fail due to conflict of ordering requirements
16 SELECT DISTINCT ON (string4, ten) string4, two, ten
17    FROM tmp
18    ORDER BY string4 using <, two using <, ten using <;
19 ERROR:  SELECT DISTINCT ON expressions must match initial ORDER BY expressions
20 SELECT DISTINCT ON (string4, ten) string4, ten, two
21    FROM tmp
22    ORDER BY string4 using <, ten using >, two using <;
23  string4 | ten | two 
24 ---------+-----+-----
25  AAAAxx  |   9 |   1
26  AAAAxx  |   8 |   0
27  AAAAxx  |   7 |   1
28  AAAAxx  |   6 |   0
29  AAAAxx  |   5 |   1
30  AAAAxx  |   4 |   0
31  AAAAxx  |   3 |   1
32  AAAAxx  |   2 |   0
33  AAAAxx  |   1 |   1
34  AAAAxx  |   0 |   0
35  HHHHxx  |   9 |   1
36  HHHHxx  |   8 |   0
37  HHHHxx  |   7 |   1
38  HHHHxx  |   6 |   0
39  HHHHxx  |   5 |   1
40  HHHHxx  |   4 |   0
41  HHHHxx  |   3 |   1
42  HHHHxx  |   2 |   0
43  HHHHxx  |   1 |   1
44  HHHHxx  |   0 |   0
45  OOOOxx  |   9 |   1
46  OOOOxx  |   8 |   0
47  OOOOxx  |   7 |   1
48  OOOOxx  |   6 |   0
49  OOOOxx  |   5 |   1
50  OOOOxx  |   4 |   0
51  OOOOxx  |   3 |   1
52  OOOOxx  |   2 |   0
53  OOOOxx  |   1 |   1
54  OOOOxx  |   0 |   0
55  VVVVxx  |   9 |   1
56  VVVVxx  |   8 |   0
57  VVVVxx  |   7 |   1
58  VVVVxx  |   6 |   0
59  VVVVxx  |   5 |   1
60  VVVVxx  |   4 |   0
61  VVVVxx  |   3 |   1
62  VVVVxx  |   2 |   0
63  VVVVxx  |   1 |   1
64  VVVVxx  |   0 |   0
65 (40 rows)
66