> From: pgsql-general-owner@xxxxxxxxxxxxxx [mailto:pgsql-general- > owner@xxxxxxxxxxxxxx] On Behalf Of Clark Slater > Sent: Tuesday, July 14, 2009 10:04 AM > Subject: filter duplicates by priority Maybe I'm missing something, but why not something like (incoming pseudo-SQL): Select part_number, max(priority) From ( Select part_number, priority from TableAndCriteria Union all Select part_number, priority from TableAndCriteria Union all Select part_number, priority from TableAndCriteria ) as allTables Group by part_number Matthew Hartman Programmer/Analyst Information Management, ICP Kingston General Hospital .now. -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general