On Mon, Mar 21, 2005 at 07:20:04PM +0000, Peter Cottingham wrote: > > Appears that the GROUP BY clause is not working correctly on new server > (GROUP BY should order the result set in ASCENDING order, NOT DESCENDING > order.) See below > > ********************************** > select dom_id, count(ste_id) as ste_count > from ste > group by dom_id > **********************************
As far as I know, the SQL standards don't specify that GROUP BY is supposed to give a particular order. A query without an ORDER BY clause, or a query with an ORDER BY clause that isn't specific enough, has an order that's implementation-dependent. If you want a particular order then use ORDER BY. Somebody please correct me if I'm mistaken (with a relevant citation from one of the standards). -- Michael Fuhr http://www.fuhr.org/~mfuhr/ ---------------------------(end of broadcast)--------------------------- TIP 9: the planner will ignore your desire to choose an index scan if your joining column's datatypes do not match