On Thu, Jul 16, 2009 at 11:57:56AM +0200, A B wrote:
>
> select distinct userid from usertable,<more tables> where <conditions>;
>
> and then count the rows in the result
make it a subselect and count in the outer select:
select count(*) as num from (select distinct...) dummy;