|
|
Archives of the TeradataForum
Message Posted: Wed, 30 Jan 2002 @ 09:34:29 GMT
Subj: | | Re: SAMPLE statement for multiple groups |
|
From: | | Dieter N�th |
If you're running R4 you could use the RANDOM function:
select ...
where
(group_id = 1 and random(1,100) <= 5) --5%
or
(group_id = 2 and random(1,100) <= 20) --20%
or
(group_id = 3 and random(1,100) <= 10) --10%
Sample uses the random function, but there's a difference: a sample 0.1 from 100 records is always 10 records a random(1,100) <= 10 is
about 10 records, sometimes less sometimes more
Dieter
| |