Archives of the TeradataForum
Message Posted: Tue, 26 Oct 2010 @ 19:39:32 GMT
A (might-be) very basic technical question on creating a temporary pivot table, or kind of.
I have several source tables (tsrc1, tsrc2, tsrc3, etc) which all consists of the following fields:
col1, col2, attr1, attr2, attrN.
I want to create a temporary table holding the following content:
col1, attr1, attr2, attrN. col2, attr1, attr2, attrN.
I,e, one row from source table creates two rows in the temporary pivot table. Moreover, the above fields from *all source tables* (tsrc1, tsrc2, tsrc3, etc) are inserted into the pivot table the same way.
Furthermore, the final pivot table is ordered by col, and given a surrogate key from 1 to the number of records in pivot table.
Please help. I'm good at SQL, but completely new to Teradata bteq. Hope that I've describe my problem clear enough. If there is anything impossible, e.g.say creating a temporary table, please give me your recommended workaround.
Thanks a lot for your help.
|Copyright 2016 - All Rights Reserved|
|Last Modified: 28 Jun 2020|