[thelist] Random value between 1 and x with SQL Server 2K

rudy r937 at interlog.com
Sun Jul 29 15:35:40 CDT 2001


> select foo
>  from bar
> where foo=bar
> having count(*) = @nvarrs

echhh


> but I don't think I've ever seen a having clause with an equality.
> doesn't mean you can't (maybe it does), but it does give me that
> weird feeling like rudy's going to yell at me or something.

hey, i would never yell

guy, set @nvarrs = (ceiling(rand()*(@nvarrc))) looks okay to me

the stored proc approach is the best, too

try it on 5,000 records instead of 5


rudy






More information about the thelist mailing list