On Sat, 2006-05-27 at 11:51 -0700, Richard Broersma Jr wrote:
> select count(xxx.id) as cnt,
> xxx.id,
> xxx_grp.id as grpid,
> xxx_grp.grp
> from xxx
> right join xxx_grp
> on (xxx.id = xxx_grp.id)
> group by xxx.id, grpid, xxx_grp.grp
> order by xxx_grp.id;
>
> cnt | id | grpid | grp
> -----+----+-------+--------
> 0 | | 0 | group0
> 1 | 1 | 1 | group1
> 2 | 2 | 2 | group2
The count() in my case may easyly reach 10k (so the group table wont end
up too light, and it have to have a margin), but that's something
concrete to start with.
Thenx.
--
-R