Is the number of COMMUNICATION_IDs known and small:
SAMPLE
WHEN COMMUNICATION_ID = x1 THEN 0.1
WHEN COMMUNICATION_ID = x2 THEN 0.1
WHEN COMMUNICATION_ID = x3 THEN 0.1
WHEN COMMUNICATION_ID = x4 THEN 0.1
ELSE 0.1
ENDThis could be created dynamically based on the actual data, but i don't know if there's a limit for the number of WHENs.
Or use "WHERE RANDOM(1,10) = 1", but this is not exactly 10% and might miss an id with a small number of rows (this will also happen with SAMLPE when the number of rows is less than 5).
What do you mean by "set MIN and MAX"?
Dieter
↧