From: Darren Greer <dgreer@websightsolutions.com>
To: pgsql-sql@postgreSQL.org
Subject: oidrand question
Date: Wed, 23 Jun 1999 06:54:20 -0500
Message-ID: <9906230705310F.13060@george> (raw)
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: dgreer@websightsolutions.com
Subject: Re: oidrand question
In-Reply-To: <9906230705310F.13060@george>
References: <9906230705310F.13060@george>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox