This solved my problem. Now why didn't I think of that!? Thank you very
much everybody. This list is an incredible resource.
-Clark
> AFAICS, changing it to ORDER BY part_number,priority would solve the
> stated problem. If you really need the final result in priority rather
> than part numb
On Tue, Jul 14, 2009 at 10:04:12AM -0400, Clark Slater wrote:
> SELECT DISTINCT ON (part_number) * FROM (
> SELECT part_number, priority FROM ...
> UNION ALL
> SELECT part_number, priority FROM ...
> UNION ALL
> SELECT part_number, priority FROM ...
> ) AS filter_duplicates ORDER BY priority,part_n
On Tue, Jul 14, 2009 at 10:04:12AM -0400, Clark Slater wrote:
> Hello-
>
> I am trying to use DISTINCT ON to filter out *potential* duplicate values
> from a set of sub queries. There are certain cases where there can be
> repetitive part numbers that are priced differently. I'm trying to start
"Clark Slater" writes:
> I am trying to use DISTINCT ON to filter out *potential* duplicate values
> from a set of sub queries. There are certain cases where there can be
> repetitive part numbers that are priced differently. I'm trying to start
> with the full list, ordered by priority, and the
> From: pgsql-general-ow...@postgresql.org [mailto:pgsql-general-
> ow...@postgresql.org] On Behalf Of Clark Slater
> Sent: Tuesday, July 14, 2009 10:04 AM
> Subject: [GENERAL] filter duplicates by priority
Maybe I'm missing something, but why not something like (incoming
pse
Hello-
I am trying to use DISTINCT ON to filter out *potential* duplicate values
from a set of sub queries. There are certain cases where there can be
repetitive part numbers that are priced differently. I'm trying to start
with the full list, ordered by priority, and then remove any repeats tha