All Forums Analytics
Developer 3 posts Joined 05/06
11 May 2006
Any equivalent pseudo columns in TD like ROWNUM in Oracle

Hi Guys,Is there any pseducolumn concept in TD like ROWNUM in Oracle or, is there any way to get first 100 rows of a table ? Suggestions appreciated.Thanks,

Sunil Agrawal 12 posts Joined 07/04
11 May 2006

The below query will return 100 rows in increasing order of col1.select col1 , col2 . . , row_number() over (order by col1) as row_numfrom tablenamequalify row_num <= 100;There are many additional functions like row_number() over (partition by col1 order by col2) etc.Hope this helps.

Developer 3 posts Joined 05/06
12 May 2006

Thanks for reply. I guess that would help.

DGiabbai 47 posts Joined 07/04
12 May 2006

It is difficult to apply the concept of "the first N columns" to a parallel environment (like TeraData is), where data is uniformly distributed through the amps (in a normal situation).In general, with Teradata you'd query a sample of data (using the "sample" SQL clause).E.g.: select * from table sample 100;My two cents...

You must sign in to leave a comment.