Re: More on unique vs distinct

From: "Joshua D(dot) Drake" <jd(at)commandprompt(dot)com>
To: Rodrigo Gonzalez <rjgonzale(at)gmail(dot)com>
Cc: stafford(at)marine(dot)rutgers(dot)edu, pgsql-general(at)postgresql(dot)org
Subject: Re: More on unique vs distinct
Date: 2006-11-20 23:13:10
Message-ID: 1164064390.16182.118.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Mon, 2006-11-20 at 19:46 -0300, Rodrigo Gonzalez wrote:
> Not 100% sure....
>
> select count(*) from (select distinct source_id from obis_sources) t

SELECT count(source_id) FROM obis_sources GROUP BY source_id ?

Joshua D. Drake

>
> Wm.A.Stafford wrote:
> > I guess I should have been a bit more specific. Here is an example of
> > the type of query I'm finding in the Oracle app and the results of my
> > attempt to find a PostgreSQL equivalent.
> >
> > select count(unique 'source_id') from obis_sources;
> > pgAdmin III query responds:
> > ERROR: syntax error at or near "'source_id'" at character 23
> >
> > select count(distinct 'source_id') from obis_sources;
> > pgAdmin III query responds:
> > ERROR: could not identify an equality operator for type "unknown"
> >
> > Thanks for all the help,
> > -=bill
> >
> >
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 1: if posting/reading through Usenet, please send an appropriate
> > subscribe-nomail command to majordomo(at)postgresql(dot)org so that your
> > message can get through to the mailing list cleanly
> >
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org/
>
--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/

Donate to the PostgreSQL Project: http://www.postgresql.org/about/donate

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2006-11-20 23:13:32 Re: PostgreSQL equivalent of the Oracale 'unique'
Previous Message Rafal Pietrak 2006-11-20 22:59:42 Re: functions: stable/volatile