Archives of the TeradataForum
Message Posted: Fri, 31 May 2002 @ 16:49:16 GMT
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,
|Copyright 2016 - All Rights Reserved|
|Last Modified: 28 Jun 2020|