[prev in list] [next in list] [prev in thread] [next in thread] 

List:       postgresql-sql
Subject:    [SQL] oidrand question
From:       Darren Greer <dgreer () websightsolutions ! com>
Date:       1999-06-23 11:54:20
[Download RAW message or body]

Hello again all.  First I would like to thank all those who helped me with the
multiple select statement.  Thanks to your help, it is working fine.

I am in the process of using oidrand inside of a select statement.  However, I
am noticing some wierd results when I feed certain numbers in.  Here is a
sample select statement.

	select * from listeners where station = 'KKLS' and oidrand(oid, 2);

This returns, as expected, about 50% of the results.  Another:
	
	select * from listeners where station = 'KKLS' and oidrand(oid, 3);

This return about 33%.

Now lets say that I want to get 75% of the results.  I would put 1.333 in
there, but it does not return 75%, it return 100%.  This tells me that this is
rounding to the nearest whole number.  If so, how does one get say 75% of the
results?

Thanks,

Darren

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic