On Wed, 30 May 2001, Nicolas wrote:
> 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.
If there is only one distinct url for each author then:
select distinct author, url from books;
If not, *which* url do you want to get?
If it doesn't matter, you can use a non-standard structure:
select distinct on (author) author, url;
If you wanted (for example) the url that could be considered
the minimum, you could do something like:
select author, min(url) from books group by author;
---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])