Re: SELECT DISTINCT and count(1)

From: A B <gentosaker(at)gmail(dot)com>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: SELECT DISTINCT and count(1)
Date: 2009-07-16 10:16:32
Message-ID: dbbf25900907160316t5289f23vf00609111e851930@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Thank you both for both for your replies.

2009/7/16 Maximilian Tyrtania <maximilian(dot)tyrtania(at)onlinehome(dot)de>:
> am 16.07.2009 11:57 Uhr schrieb A B unter gentosaker(at)gmail(dot)com:
>
>> Hi.
>> I need to do a
>>
>> select distinct userid  from  usertable,<more tables>  where <conditions>;
>>
>> and then count the rows in the result
>>
>> How do I do that?
>
> Try:
>
> select count(distinct(userid))  from  usertable,<more tables>  where
> <conditions>;
>
> Best wishes from Berlin,
>
> Maximilian Tyrtania
>
>
>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Emil Obermayr 2009-07-16 10:42:12 Re: SELECT DISTINCT and count(1)
Previous Message A B 2009-07-16 09:57:56 SELECT DISTINCT and count(1)