Re: [SQL] Using ORDER BY with AGGREGATE/GROUP BY in a SELECT statement

2001-05-14 Thread David D. Kilzer
Tom, Thanks for the reply, and for correcting my broken SQL. :^) A couple days after I sent my own follow-up message, I realized how silly my question was. I'll let future questions sit a bit longer next time. To make up for my silly question, here is a function + aggregate I created while w

Re: [SQL] Using ORDER BY with AGGREGATE/GROUP BY in a SELECT statement

2001-05-11 Thread Tom Lane
"David D. Kilzer" <[EMAIL PROTECTED]> writes: > [ wants to write an aggregate function that returns its last input ] The SQL model of query processing has a very definite view of the stages of processing: first group by, then aggregate, and last order by. Tuple ordering is irrelevant according t

[SQL] Using ORDER BY with AGGREGATE/GROUP BY in a SELECT statement

2001-05-11 Thread David D. Kilzer
NOTE: I did a moderate search through the PgSQL mail list archives, but couldn't find an example of a question where both ORDER BY and aggregation were used. In all examples it was possible to use either one or the other with a possible subselect. [Keep reading...I discovered how to do this wit