Re: Distinct Values

From: Hans-Jürgen Schönig <hs(at)cybertec(dot)at>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: Distinct Values
Date: 2001-06-05 09:18:42
Message-ID: 3B1CA3F2.11015CC7@cybertec.at
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Nicolas schrieb:

> Hi,
>
> I'm trying to retreive DISTINCT Values from a two colomn table called
> "Books". The colomns are named "Author" and "URL".
> DISTINCT values should be retieved from the "Author" Colomn , and then I
> should be able to retrieve the corresponding URL.
> How do I build the SQL Query ?
> I tried to use: "SELECT DISTINCT Author FROM Books" But this does not allow
> me to fetch the URL value on the other colomn.
>
> Thanks
> Nicolas

The problem is that one author may have multiple urls - if you want to select
the url too, the database does not know which url to retrieve.

Hans

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Hans-Jürgen Schönig 2001-06-05 09:20:56 Re: Distinct Values
Previous Message Mikael Kjellstrm 2001-06-05 08:23:40 Foreign key to base table with rows in inherited tables