Re: How to remove duplicate lines but save one of the lines? - Mailing list pgsql-general

From Francisco Reyes
Subject Re: How to remove duplicate lines but save one of the lines?
Date
Msg-id f70a889ad5ab8c33dd2defc351f8c05a@stringsutils.com
Whole thread Raw
In response to How to remove duplicate lines but save one of the lines?  ("A B" <gentosaker@gmail.com>)
List pgsql-general
On 11:33 am 07/21/08 "A B" <gentosaker@gmail.com> wrote:
> and I want it to be
> A 1
> B 3
> C 44

The slow way
select distinct field1, field2 from sometable.

The faster way
select field1,fields2 from sometable group by field1, field2.

Distinct should in theory be the same speed, but on several tests I have
done group by was faster. I posted a message to the list and there were
some explanations why group by was faster.. Hopefully someday they should
perform just as  efficiently.


pgsql-general by date:

Previous
From: Said Ramirez
Date:
Subject: Re: How to remove duplicate lines but save one of the lines?
Next
From: "A B"
Date:
Subject: Re: How to remove duplicate lines but save one of the lines?