From: Hans-Jürgen Schönig <hs@cybertec.at>
To: pgsql-sql@postgresql.org
Subject: Re: Distinct Values
Date: Tue, 05 Jun 2001 11:18:42 +0200
Message-ID: <3B1CA3F2.11015CC7@cybertec.at> (raw)
References: <HTaR6.40412$712.4747796@amsnews02.chello.com>
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
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: hs@cybertec.at
Subject: Re: Distinct Values
In-Reply-To: <3B1CA3F2.11015CC7@cybertec.at>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox