~vcs-imports/mammoth-replicator/trunk

« back to all changes in this revision

Viewing changes to src/test/regress/expected/select_distinct_on.out

  • Committer: alvherre
  • Date: 2005-12-16 21:24:52 UTC
  • Revision ID: svn-v4:db760fc0-0f08-0410-9d63-cc6633f64896:trunk:1
Initial import of the REL8_0_3 sources from the Pgsql CVS repository.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
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