You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: contrib/tablefunc/expected/tablefunc.out
+28-19
Original file line number
Diff line number
Diff line change
@@ -23,42 +23,48 @@ SELECT * FROM crosstab2('SELECT rowid, attribute, val FROM ct where rowclass = '
23
23
----------+------------+------------
24
24
test1 | val2 | val3
25
25
test2 | val6 | val7
26
-
(2 rows)
26
+
| val10 | val11
27
+
(3 rows)
27
28
28
29
SELECT * FROM crosstab3('SELECT rowid, attribute, val FROM ct where rowclass = ''group1'' and (attribute = ''att2'' or attribute = ''att3'') ORDER BY 1,2;');
29
30
row_name | category_1 | category_2 | category_3
30
31
----------+------------+------------+------------
31
32
test1 | val2 | val3 |
32
33
test2 | val6 | val7 |
33
-
(2 rows)
34
+
| val10 | val11 |
35
+
(3 rows)
34
36
35
37
SELECT * FROM crosstab4('SELECT rowid, attribute, val FROM ct where rowclass = ''group1'' and (attribute = ''att2'' or attribute = ''att3'') ORDER BY 1,2;');
SELECT * FROM crosstab2('SELECT rowid, attribute, val FROM ct where rowclass = ''group2'' and (attribute = ''att1'' or attribute = ''att2'') ORDER BY 1,2;');
64
70
row_name | category_1 | category_2
@@ -103,25 +109,28 @@ SELECT * FROM crosstab4('SELECT rowid, attribute, val FROM ct where rowclass = '
103
109
(2 rows)
104
110
105
111
SELECT * FROM crosstab('SELECT rowid, attribute, val FROM ct where rowclass = ''group1'' ORDER BY 1,2;', 2) AS c(rowid text, att1 text, att2 text);
106
-
rowid | att1 | att2
107
-
-------+------+------
112
+
rowid | att1 | att2
113
+
-------+------+-------
108
114
test1 | val1 | val2
109
115
test2 | val5 | val6
110
-
(2 rows)
116
+
| val9 | val10
117
+
(3 rows)
111
118
112
119
SELECT * FROM crosstab('SELECT rowid, attribute, val FROM ct where rowclass = ''group1'' ORDER BY 1,2;', 3) AS c(rowid text, att1 text, att2 text, att3 text);
113
-
rowid | att1 | att2 | att3
114
-
-------+------+------+------
115
-
test1 | val1 | val2 | val3
116
-
test2 | val5 | val6 | val7
117
-
(2 rows)
120
+
rowid | att1 | att2 | att3
121
+
-------+------+-------+-------
122
+
test1 | val1 | val2 | val3
123
+
test2 | val5 | val6 | val7
124
+
| val9 | val10 | val11
125
+
(3 rows)
118
126
119
127
SELECT * FROM crosstab('SELECT rowid, attribute, val FROM ct where rowclass = ''group1'' ORDER BY 1,2;', 4) AS c(rowid text, att1 text, att2 text, att3 text, att4 text);
0 commit comments