Re: Distinct Values - Mailing list pgsql-sql

From Hans-Jürgen Schönig
Subject Re: Distinct Values
Date
Msg-id 3B1CA3F2.11015CC7@cybertec.at
Whole thread Raw
In response to Distinct Values  ("Nicolas" <bnk@medialife.net>)
List 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



pgsql-sql by date:

Previous
From: mikael.kjellstrom@_no_spam_flygtaxi.se (Mikael Kjellström)
Date:
Subject: Cluster and primary key
Next
From: "Postgresql"
Date:
Subject: cascading delete - recursivity