On Mon, 01 Mar 2004 13:12:12 +1100 Klint Gore <[EMAIL PROTECTED]> 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 ======================================================================== ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match