Received: from postgresql.org.org (webmail.postgresql.org [216.126.85.28]) by postgresql.org (8.11.3/8.11.1) with SMTP id f5CGDGE31461 for ; Tue, 12 Jun 2001 12:13:16 -0400 (EDT) (envelope-from pgsql-sql-owner@postgresql.org) Received: from news.tht.net (news.hub.org [216.126.91.242]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f559SXE06837 for ; Tue, 5 Jun 2001 05:28:33 -0400 (EDT) (envelope-from news@news.tht.net) Received: (from news@localhost) by news.tht.net (8.11.1/8.11.1) id f559KLW82808 for pgsql-sql@postgresql.org; Tue, 5 Jun 2001 05:20:21 -0400 (EDT) (envelope-from news) From: =?iso-8859-1?Q?Hans=2DJ=FCrgen=20Sch=F6nig?= X-Newsgroups: comp.databases.postgresql.sql Subject: Re: Distinct Values Date: Tue, 05 Jun 2001 11:18:42 +0200 Organization: Hub.Org Networking Services (http://www.hub.org) Lines: 20 Message-ID: <3B1CA3F2.11015CC7@cybertec.at> References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Complaints-To: scrappy@hub.org X-Mailer: Mozilla 4.77 [de] (X11; U; Linux 2.4.2-2 i686) X-Accept-Language: en To: pgsql-sql@postgresql.org X-Archive-Number: 200106/179 X-Sequence-Number: 3403 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