On Tue, Apr 02, 2002 at 06:57:21AM +0000, Heiko Klein wrote:
> Hi,
>
> out of a table i.e. people:
> id last first sex age address
>
> I would like to select a random id. Id's are a sequence, but some
> peoble have been deleted, so there are several id-holes in the
> table.
>
> Furthermore, I would like to specify the random person, like
>
> select 'random person id' from table where age > 60 and sex = 'm';
select * from table where age > 60 and sex = 'm' order by random() limit 1;
IIRC
HTH,
--
Martijn van Oosterhout <kleptog@svana.org> http://svana.org/kleptog/
> Ignorance continues to thrive when intelligent people choose to do
> nothing. Speaking out against censorship and ignorance is the imperative
> of all intelligent people.