Proper syntax of WHERE (select...)? - Mailing list pgsql-sql

From Justin Long
Subject Proper syntax of WHERE (select...)?
Date
Msg-id 006301bf0f3a$9caf09a0$95421a9f@nsmjustinlong.cbn.org
Whole thread Raw
In response to Function error  ("Adam H. Pendleton" <apendleton@vgsinc.com>)
List pgsql-sql
I am attempting to generate a random select from a database. Here's
basically what I'm trying to do:
1. select the qualified segments from a databaes    (the query is...        where moderator>'' and leadin>'')
2. from this selection, select 3 random segments.

I had thought that

select id,name,leadin from country whereoidrand(oid,3) in (select id,name,leadin from country where moderator>''
and leadin>'');

would work, but it definitely doesn't. I've been hacking around on this for
a while and can't seem to find a solution. I can get the system to select a
random number from the database, but not a random number of qualified
results.

Any suggestions from anyone?


Never retreat. Never surrender. Never cut a deal with a dragon.
_______________________________________________________________
Justin Long                       Executive Producer
616 Station Square Ct             http://www.strategicnetwork.org
Chesapeake, VA 23320              Network for Strategic Missions
JustinLong@strategicnetwork.org    977 Centerville Trnpk CSB 317
757-226-5011                Va Beach, VA 23463, USA



pgsql-sql by date:

Previous
From: Sergey Bondarenko
Date:
Subject: RE: [SQL] 2 Aktions in a Rule
Next
From: Tom Lane
Date:
Subject: Re: [SQL] 2 Aktions in a Rule