HP Neoview SQL Reference Manual page 276

Hide thumbs Also See for Neoview SQL:
Table of Contents

Advertisement

The result table of the TRANSPOSE query is:
KEYCOL
1
2
3
4
5
6
1
2
3
4
5
6
A question mark (?) in a value column indicates no value for the given KEYCOL.
This query shows how the preceding query can include a GROUP BY clause:
SELECT KEYCOL, VALCOL1, VALCOL2, COUNT(*) FROM mytable
TRANSPOSE A, B, C AS VALCOL1
KEY BY KEYCOL
GROUP BY KEYCOL, VALCOL1, VALCOL2;
The result table of the TRANSPOSE query is:
KEYCOL
1
2
3
1
2
3
4
5
6
4
5
6
This query shows how an item in the transpose item list can contain a list of expressions
and that the KEY BY clause is optional:
SELECT * FROM mytable
TRANSPOSE (1, A, 'abc'), (2, B, 'xyz')
AS (VALCOL1, VALCOL2, VALCOL3);
276
SQL Clauses
VALCOL1
1
10
100
?
?
?
2
20
200
?
?
?
D, E, F AS VALCOL2
VALCOL1
1
10
100
2
20
200
?
?
?
?
?
?
VALCOL2
?
?
?
d1
e1
f1
?
?
?
d2
e2
f2
VALCOL2
?
?
?
?
?
?
d2
e2
f2
d1
e1
f1
(EXPR)
1
1
1
1
1
1
1
1
1
1
1
1

Advertisement

Table of Contents
loading

Table of Contents