Proper syntax of WHERE (select...)?

Поиск
Список
Период
Сортировка
От Justin Long
Тема Proper syntax of WHERE (select...)?
Дата
Msg-id 006301bf0f3a$9caf09a0$95421a9f@nsmjustinlong.cbn.org
обсуждение исходный текст
Ответ на Function error  ("Adam H. Pendleton" <apendleton@vgsinc.com>)
Список 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 по дате отправления:

Предыдущее
От: Sergey Bondarenko
Дата:
Сообщение: RE: [SQL] 2 Aktions in a Rule
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [SQL] 2 Aktions in a Rule