SELECT query

Поиск
Список
Период
Сортировка
От G. Anthony Reina
Тема SELECT query
Дата
Msg-id 3AAFC2F1.AEEAAFB2@nsi.edu
обсуждение исходный текст
Ответы Re: SELECT query
Список pgsql-novice
I can't figure out how to make the following query:

Table = circles_proc

subject     text,
arm          char,
rep            int,
cycle         int


I'd like to find the unique subject, arm, and rep tuples where the rep
has exactly 5 cycles associated with it.

I think it would be something like:
select distinct subject, arm, rep from circles_proc where rep = (select
rep  from circles_proc where 5 = count(cycle));

but the count is going to be performed over all tuples returned. I'd
like to have the count performed over each rep and just find the reps
where there are 5 cycles.

Can someone help?
Thanks.
-Tony



В списке pgsql-novice по дате отправления: