![]() |
|
Archives of the TeradataForumMessage Posted: Wed, 03 Nov 2010 @ 10:19:30 GMT
Hi Lakhwant, Below query will give you the desired result:-
Insert into Table-B
(
Row_nbr,
,Field1
,Field2
,Field3
,Field4
)
Select
Row_number() Over (Order By Field1, Field2, Field3,Field4)
,Field1
,Field2
,Field3
,Field4
From Table-A;
Reason:- If you do Sel * from Table A; - You will get random result set reason being rows are not stored in any specific order in Teradata or what sequence you Insert Records doesn t matter. Further the problem with your query was you didn t include Field4 in Order By Clause. Therefore Teradata Sorted the result set based on 3 Fields only. Regards, Yash Ballani
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||