I just wanted to give my cheers for DISTINCT ON. It is a great feature, I've just found a really good use for it. I am just wondering why it didn't make it into the standards.
On a slightly unrelated note, I had the opportunity to work with EQUEL for a short period of time some 15 years ago before I started getting famililar with SQL. I clearly remember the disappointment/surprise I felt as I was struggling to translate some of the constructs I used with EQUEL into SQL. At that time, I thought that (the by then defunct) EQUEL was much more expressive/intuitive/flexible/easier-to-use than SQL. I've been wondering ever since why the worse so often gets the upper-hand over the better. (I am obviously having a hard time "growing-up" :-) ) Cheers, Peter ---------------------------(end of broadcast)--------------------------- TIP 9: In versions below 8.0, the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match