![]() |
|
Archives of the TeradataForumMessage Posted: Tue, 07 Jun 2005 @ 06:52:48 GMT
Hi Arun,
select
APP_NUM,
REP_ID
from
(
select
APP_NUM,
REP_ID,
random(-200000000,+200000000) as r
FROM TABLE T1
) dt
qualify row_number() over (partition by REP_ID order by r) <= 5
I had to use a derived table, because random is not allowed within an OLAP function... Dieter
| ||||||||||||||||||||||||||||||||||||||||||||||||
| | ||||||||||||||||||||||||||||||||||||||||||||||||
| ||||||||||||||||||||||||||||||||||||||||||||||||
|
| ||||||||||||||||||||||||||||||||||||||||||||||||
| Copyright 2016 - All Rights Reserved | ||||||||||||||||||||||||||||||||||||||||||||||||
| Last Modified: 15 Jun 2023 | ||||||||||||||||||||||||||||||||||||||||||||||||