Tom Lane wrote:
>
> SELECT DISTINCT ON place * FROM table ORDER BY place, time DESC;
>
> might do the right thing. It *seems* to select the first row for each
> value of place. I've never seen a spec for this feature, however, so
> I'm not sure if it's reliable or not...
Works a treat when I try it on the "real" database (using 6.4.2). It seems
very efficient. I didn't realise that "DISTINCT ON" worked that way with an
"ORDER BY".
I must say I'm overwhelmed by the variety of constructive responses to my
request. Thank you all very much. It beats the hell out of sitting as no 17
in a premium rate telephone queue for support from a vendor of a "commercial"
product.
--
Julian Scarfe