>>Here's my query -
>>sele dist cellcode, count(cellcode)
>>from x where fdisp="01" group by cellcode. What I want this to do is show me ALL the distinct cellcodes along with the counts of FDISPs for each cellcode. If there are 0 fdisps, it needs to show me null or 0 for that cellcode
>
>Try
SELECT cellcode, count(*) ;
> FROM mytable ;
> WHERE fdisp="01" ;
> GROUP BY 1
Actually, this will only give you cellcodes having at least one fdisp='01'; to do what he wants:
SELECT cellcode, SUM(iif(fdisp='01',1,0)) as fdispcount ;
FROM mytable ;
GROUP BY cellcode