Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Mon, 01 Nov 2010 @ 18:53:12 GMT


     
  <Prev Next>   <<First <Prev Next> Last>>  


Subj:   Re: Need Same Order as in input table
 
From:   Curley, David

You're not ordering by all the fields. You have Row_number() Over (Order By Field1, Field2, Field3), but your sample records are tied over those three fields and Teradata is free to choose whatever order it wants within any tie. In this specific example, you could add "Field4 desc" and you'd get the expected order.

But it could be that you're trying to establish order where there isn't any. Tables do not have order (arguably leaving aside queue tables). A table may have one or more fields that can be used to order it, but there is no intrinsic order. So if "Field4 desc" won't always work for you and there's nothing equivalent to an event timestamp or source-system-generated always-increasing ID, then you will never be assure a recreation of the so-called order of Table A.


Dave



     
  <Prev Next>   <<First <Prev Next> Last>>  
 
 
 
 
 
 
 
 
  
  Top Home Privacy Feedback  
 
 
Copyright for the TeradataForum (TDATA-L), Manta BlueSky    
Copyright 2016 - All Rights Reserved    
Last Modified: 15 Jun 2023