|
|
Archives of the TeradataForum
Message Posted: Wed, 27 Oct 2010 @ 08:49:12 GMT
Subj: | | Re: Pivot temp table |
|
From: | | Stieger, Etienne |
Hi Faible,
Try something like:
Select T_1.col, T_1.attr1, T_1.attr2, T_1.attrN,
ROW_NUMBER() OVER (PARTITION BY T_1.col, T_1.attr1, T_1.attr2, T_1.attrN ORDER BY T_1.col
asc, T_1.attr1 asc, T_1.attr2 asc, T_1.attrN asc) SurKey From ( Select col1 as col,
attr1, attr2, attrN from tsrc1 Union all Select col2 as col, attr1, attr2, attrN from
tsrc1 Union all Select col1 as col, attr1, attr2, attrN from tsrc2 Union all Select col2
as col, attr1, attr2, attrN from tsrc2 Etc...
Etc...
) T_1
Regards
Etienne Stieger
Etienne Stieger
DW DBA, Technical Specialist
Analytics and Information Management (AIM/EIW)
Standard Bank
| |