pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedDISTINCT
4+ messages / 3 participants
[nested] [flat]
* DISTINCT
@ 1999-11-08 21:52 raptor <raptor@unacs.bg>
0 siblings, 0 replies; 4+ messages in thread
From: raptor @ 1999-11-08 21:52 UTC (permalink / raw)
To: pgsql-sql
hi,
I have one big Query and it seems that DISTINCT didn't work (I'm not
sure 100% but I'm asking in any case). I've read in emails going trought
the list that there is problems with such queries, but can't remember it
...
Is there anywhere some place FAQ/HOWTO where I can see all this
nonworking stuff on one place or the cases where I can have a problems
... and their workarounds ...
I've read the FAQ :")
thax alot in advance
=====
iVAN
raptor@unacs.bg
=====
^ permalink raw reply [nested|flat] 4+ messages in thread
* DISTINCT
@ 2002-09-13 02:31 Rudi Starcevic <rudi@oasis.net.au>
2002-09-13 02:30 ` Re: DISTINCT Christopher Kings-Lynne <chriskl@familyhealth.com.au>
0 siblings, 1 reply; 4+ messages in thread
From: Rudi Starcevic @ 2002-09-13 02:31 UTC (permalink / raw)
To: 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
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: DISTINCT
2002-09-13 02:31 DISTINCT Rudi Starcevic <rudi@oasis.net.au>
@ 2002-09-13 02:30 ` Christopher Kings-Lynne <chriskl@familyhealth.com.au>
2002-09-13 02:44 ` Re: DISTINCT Rudi Starcevic <rudi@oasis.net.au>
0 siblings, 1 reply; 4+ messages in thread
From: Christopher Kings-Lynne @ 2002-09-13 02:30 UTC (permalink / raw)
To: Rudi Starcevic <rudi@oasis.net.au>; pgsql-sql
> 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;
SELECT
DISTINCT ON (phone)
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;
^ permalink raw reply [nested|flat] 4+ messages in thread
* Re: DISTINCT
2002-09-13 02:31 DISTINCT Rudi Starcevic <rudi@oasis.net.au>
2002-09-13 02:30 ` Re: DISTINCT Christopher Kings-Lynne <chriskl@familyhealth.com.au>
@ 2002-09-13 02:44 ` Rudi Starcevic <rudi@oasis.net.au>
0 siblings, 0 replies; 4+ messages in thread
From: Rudi Starcevic @ 2002-09-13 02:44 UTC (permalink / raw)
To: Christopher Kings-Lynne <chriskl@familyhealth.com.au>; +Cc: pgsql-sql
Christopher,
Thank you.
I though if I'm lucky Chris will be online and will see that one.
Kind regards
Rudi.
^ permalink raw reply [nested|flat] 4+ messages in thread
end of thread, other threads:[~2002-09-13 02:44 UTC | newest]
Thread overview: 4+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
1999-11-08 21:52 DISTINCT raptor <raptor@unacs.bg>
2002-09-13 02:31 DISTINCT Rudi Starcevic <rudi@oasis.net.au>
2002-09-13 02:30 ` Christopher Kings-Lynne <chriskl@familyhealth.com.au>
2002-09-13 02:44 ` Rudi Starcevic <rudi@oasis.net.au>
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox