From: | Rudi Starcevic <rudi(at)oasis(dot)net(dot)au> |
---|---|
To: | pgsql-sql(at)postgresql(dot)org |
Subject: | DISTINCT |
Date: | 2002-09-13 02:31:07 |
Message-ID: | 3D814DEB.6090807@oasis.net.au |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
Hello,
I'd like to select from one table ( contains duplicates ) into a new table.
However the new table is exactly the same as the original ( duplicates
included )
I think I have a problem with my DISTINCT clause - sql below.
It seems the DISTINCT is applied to the whole row not just the 'phone'
field.
Is the a way I can select the whole row into a new table based on a DISTINCT
phone number ?
Is the a way I can select the whole row into a new table based on a DISTINCT
phone number and state ?
Else I'll need to select into a table then select again etc,etc ....to
remove duplicates.
SELECT
DISTINCT phone,
company_name,
address,
state,
idc_desc_1,
street_number,
street_name,
street_xtra,
suburb,
postcode,
area_code,
ac_phone,
fax_area_code,
fax_phone,
fax_ac_phone,
latitude,
longitude
INTO export_temp
FROM export;
Thanks
Rudi
From | Date | Subject | |
---|---|---|---|
Next Message | Rudi Starcevic | 2002-09-13 02:44:07 | Re: DISTINCT |
Previous Message | Christopher Kings-Lynne | 2002-09-13 02:30:47 | Re: DISTINCT |