Re: count(1) return 0?

Поиск
Список
Период
Сортировка
Искать
От
Zak McGregor
Тема
Re: count(1) return 0?
Дата
Msg-id
20040301042831.7fd8f4ec.zak@mighty.co.za
Ответ на
Список
Дерево обсуждения
count(1) return 0? Zak McGregor <zak@mighty.co.za>
Re: count(1) return 0? Bill Moran <wmoran@potentialtech.com>
Re: count(1) return 0? Zak McGregor <zak@mighty.co.za>
Re: count(1) return 0? "Uwe C. Schroeder" <uwe@oss4u.com>
Re: count(1) return 0? Bill Moran <wmoran@potentialtech.com>
Re: count(1) return 0? Klint Gore <kg@kgb.une.edu.au>
Re: count(1) return 0? Zak McGregor <zak@mighty.co.za>
Re: count(1) return 0? Klint Gore <kg@kgb.une.edu.au>
Re: count(1) return 0? Zak McGregor <zak@mighty.co.za>
Re: count(1) return 0? Greg Stark <gsstark@mit.edu>
Re: count(1) return 0? Kris Jurka <books@ejurka.com>
On Mon, 01 Mar 2004 13:12:12 +1100
Klint Gore  wrote:

> The counting and grouping is done after the where clause is applied.
> 
> since player iplaybadly (who was 1200's opponent) didnt win any, he/she
> is not included in the result set to be grouped and counted.  You need
> to get iplaybadly into the result set first.
> 
> try something like
> 
> select fixture, home, sum(case winner=home then 1 else 0 end) 
> >from results
> group by fixture, home

Ah, thanks, works a charm.

Thanks too to all who offered help on this one.

Ciao

Zak

--
========================================================================
http://www.carfolio.com/        Searchable database of 10 000+ car specs
========================================================================
В списке pgsql-general по дате отправления
От: Doug McNaught
Дата:
От: John Wells
Дата:
Сообщение: elog: out of memory
FAQ