Discussion: count(*)
Afficher un message
Vieux 02/10/2007, 12h50   #2
Captain Paralytic
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: count(*)

On 2 Oct, 11:30, Séverin Richard <severin.rich...@free.fr> wrote:
> hi all,
>
> ____________________
> select hspectacle.hnum, count(*)
>
> from
> hspectacle left outer join v_jprix
> on( hspectacle.hnum=v_jprix.hnum )
>
> group by hspectacle.hnum
> ____________________________
>
> gives
> hnum | count(*)
> 1232 2
> 1564 8
> 461 7
> ...
>
> But i want also the rows with count(*) = 0
>
> How to do it???
> thx


There cannot be a row with count = 0 as that implies that there are no
rows to count???

Indeed, the join seems redundant in this query as the grouping is done
on only the first table. So your query is equivalent to:

SELECT
hspectacle.hnum,
count(*)
FROM hspectacle
GROUP BY hspectacle.hnum

  Réponse avec citation
 
Page generated in 0,05515 seconds with 9 queries