Archives of the TeradataForum
Message Posted: Wed, 07 Jun 2006 @ 18:13:17 GMT
Subj: | | Re: SQL to Normalize Columns to Rows |
|
From: | | Fred W Pluebell |
Make it UNION ALL (to eliminate the "distinct" that UNION alone implies). The spool file won't include rows where the corresponding column is
NULL (and you said most of them ARE null), so this won't be as bad as you fear; it's likely your fastest option in terms of execution.
An "intermediate" solution would be to break up the INSERT/SELECT into multiple statements - as many as one per source data column.
You are correct that cursor processing will be MUCH slower than set processing.
FastExport, FastLoad to a staging table, then INSERT/SELECT to the target is just extra work.
|