All Forums Database
dharma 5 posts Joined 04/06
11 Apr 2006
Randomied sample

Can someone please helpI have a table with account_numberfirst namelast namepresent balanceoutstanding balanceASRThis table has lets say 2 million records.i have to take a sample from this table for 1000 accounts.but the requirment is that the avarage of the ASR of the base table must be very closeto the avarage of ASR of the sample data.thanks a lot for the help

young 14 posts Joined 03/06
12 Apr 2006

try to define value range of ASR, and then sample the records within one specific value range, you need to define the sample number of different range to make it close to avg value.

BBR2 96 posts Joined 12/04
19 Apr 2006

I think you can use ordered analytical functionsSEL KEY_COL,AVG(ASR) OVER() FROM TEST SAMPLE 1000; instead of 1000, you can probably give a % of record as .15 (for 15% of records).You can use this information to join back to other table or you can probably do self join.I think it this should work.Vinay

You must sign in to leave a comment.