Received: from hub.org.org (localhost [127.0.0.1]) by hub.org (8.10.1/8.11.0) with SMTP id e9TIcHZ84273 for ; Sun, 29 Oct 2000 13:38:17 -0500 (EST) (envelope-from pgsql-admin-owner@hub.org) Received: from mail.pcguru.com (mail.pcguru.com [207.54.132.211]) by hub.org (8.10.1/8.11.0) with SMTP id e9TII6Z75975 for ; Sun, 29 Oct 2000 13:18:06 -0500 (EST) (envelope-from Chris@pcguru.com) Received: from pcg_dom1-Message_Server by mail.pcguru.com with Novell_GroupWise; Sun, 29 Oct 2000 13:15:11 -0500 Message-Id: X-Mailer: Novell GroupWise Internet Agent 5.5.4.1 Date: Sun, 29 Oct 2000 13:14:47 -0500 From: "Chris Fossenier" To: Subject: Populating a Table Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Disposition: inline Content-Transfer-Encoding: 8bit X-MIME-Autoconverted: from quoted-printable to 8bit by hub.org id e9TIIAS76007 X-Archive-Number: 200010/134 X-Sequence-Number: 928 Hello, I'm sure I'll be flagged as a moron for asking this question, so be it. I have some tables of info with no primary keys. As a result the field I want to key on is repeated. My plan is to do a DISTINCT select from the un-keyed table into another table that does have constraints. Here is what I thought would work: INSERT INTO table2 SELECT DISTINCT(key), name, field1, field2 FROM table1; When I issue this statement it tells me that you cannot put in duplicate values into my key field. Why does it do that? If I issue the following statement I get exactly what I want: SELECT DISTINCT(phone) from table1; Am I using the DISTINCT function incorrectly? Is it taking all of the field and using them to create a distinct row? Any help would be appreciated. Chris.