Received: from davinci.ethosmedia.com (davinci.ethosmedia.com [209.10.40.250]) by postgresql.org (8.11.3/8.11.1) with ESMTP id f6KElaa34243 for ; Fri, 20 Jul 2001 10:47:37 -0400 (EDT) (envelope-from josh@agliodbs.com) Received: from [209.10.40.250] (account ) by davinci.ethosmedia.com (CommuniGate Pro WebUser 3.4.1) with HTTP id 88701; Fri, 20 Jul 2001 07:47:31 -0700 From: "Josh Berkus" Subject: Re: Records exactly the same. To: "Fons Rave" , pgsql-sql@postgresql.org X-Mailer: CommuniGate Pro Web Mailer v.3.4.1 Date: Fri, 20 Jul 2001 07:47:31 -0700 Message-ID: In-Reply-To: <9j4e1g$imb$1@news1.xs4all.nl> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="_===88701====davinci.ethosmedia.com===_" X-Archive-Number: 200107/275 X-Sequence-Number: 4072 This is a multi-part MIME message --_===88701====davinci.ethosmedia.com===_ Content-Type: text/plain; charset="ISO-8859-1" Content-Transfer-Encoding: 8bit Fons, > I have a file in which there are records with what people have done. > In the file > are records with name, date, what they have done, time-length, etc. > It is > possible that there are two records that are exactly the same > (somebody has done > the same, on the same day for one hour). If I use a SELECT with GROUP > on a list > with some records that are exactly the same, only ONE of the > identicals is > shown. But I want to see them all. Well, there isn't an easy answer for you ... because you've designed your database wrong. Records should *never* be the same. That is, ni fact, one of the cardinal rules of Relational Database Design. You need to add an arbitrary primary key (e.g. act_key SERIAL NOT NULL PRIMARY KEY) or some other piece of data (such as start_time) to make each record unique. Then, by including that unique data in your query, you can insure that all records are displayed. Frankly, I'm surprise that you're not getting errors when you try to DELETE a record. This usually happens in tables without a unique key. It's been my argument for some time that PostgreSQL should require a primary key on table creation. -Josh ______AGLIO DATABASE SOLUTIONS___________________________ Josh Berkus Complete information technology josh@agliodbs.com and data management solutions (415) 565-7293 for law firms, small businesses fax 621-2533 and non-profit organizations. San Francisco --_===88701====davinci.ethosmedia.com===_ Content-Type: text/plain Content-Disposition: attachment; filename="" Content-Transfer-Encoding: base64 DQo= --_===88701====davinci.ethosmedia.com===_ Content-Type: text/plain Content-Disposition: attachment; filename="" Content-Transfer-Encoding: base64 DQo= --_===88701====davinci.ethosmedia.com===_ Content-Type: text/plain Content-Disposition: attachment; filename="" Content-Transfer-Encoding: base64 DQo= --_===88701====davinci.ethosmedia.com===_--