![]() |
|
Archives of the TeradataForumMessage Posted: Mon, 17 Jul 2006 @ 21:09:30 GMT
If you are in V2R6, you can try some thing like this:
SELECT TOP 5
field1, field2
FROM table
ORDER BY 2 DESC;
Which is same as:
SELECT field1, field2
FROM table QUALIFY ROW_NUMBER () OVER (ORDER BY field DESC) <= 5;
Thanks
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||