Home Page for the TeradataForum
 

Archives of the TeradataForum

Message Posted: Fri, 31 May 2002 @ 16:49:16 GMT


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


Subj:   RANK Function ... Sorting
 
From:   William

I have a question concerning the RANK function. I am running the following rank statement, and it is working very well for me, with the exception of one detail.

rank( ) over (partition by table_nm order by database_nm , table_nm , column_nm) as Pair_Rank ,

As you can see, the rank is using a different sort method than I would prefer. In a text sort 'YIELD_IND_CD' would come before 'YIELD_INDEX' which is what I expected.

THE_INSERT  DATABASE_NM COMMA TABLE_NM COMMA
 COLUMN_NM COMMA DATA_TYPE COMMA RANK SEMICOLON

INSERT INTO Table_A VALUES ( 'database_a'  ,  'YIELD'  ,
 'YIELD_INDEX'  ,   'DECIMAL ( 4,1 )'   ,  31  ) ;
INSERT INTO Table_A  VALUES ( 'database_a'  ,  'YIELD'  ,
 'YIELD_IND_CD'  ,   'VARCHAR ( 2 )'   ,  32  ) ;

How is TeraData processing this, and what might I do to get the result I desire?


Thanks for all your help,

William



     
  <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: 27 Dec 2016