what am i doing wrong controlling rand() ms sql server 2005?
i'm perplexing name futile 10% sampling little table. i guess i'd only rand() duty name those rows where futile array reduction 0.10:
select * sometable
where somecolumn='somecondition' and
rand() < 0.10
but i shortly detected rand() always advantage same number! reminds me .

ok, problem, rand duty takes seed value. i controlling query periodically, i wish give opposite law i run opposite day, i seed multiple date unparalleled quarrel id:
select * sometable
where somecolumn='somecondition' and
rand(cast(getdate) integer) + rowid) < 0.10
i still don't any results! i arrangement futile numbers returned rand, i learn they're within slight range. appears removing futile array rand requires futile seed. i futile seed initial place, i wouldn't need futile number!
i've seen before discussions associated problem:
they don't assistance me. tablesample works during page level, good large list nonetheless little one, looks relates before where clause. tip newid doesn't work since i don't know disrespectful rows i want.
anybody have solution, during slightest hint?
edit: interjection alexcuse works sole case. incomparable question, rand behave?
Comments
Post a Comment