I was curious...
Is there a way to select distinct on a combination of some fields and
the for each record returned also get the other fields of an
arbitrarily chosen record matching the fields in the distinct record.
For example, if I have a select distinct on say three fields:
SELECT DISTINCT Code1, Code2, Code3
but the table also has other fields, maybe Foo1 and Foo2, and I want
Foo1 and Foo2 to also be displayed. Since there may be multiple
records that match a particular Code1, Code2, Code3, then I just want
one of those to be arbitrarily chosen.