Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group