How to fetch a sample of data within each group - Teradata
Scenario: We need to select a random sample of 5 in each status type
SEL Member, status FROM TABLE1 QUALIFY ROW_NUMBER() OVER ( PARTITION BY status ORDER BY NULL) <= 50;
Enjoy great content like this and a lot more !
Signup for a free account to write a post / comment / upvote posts. Its simple and takes less than 5 seconds