From: Adriano d. S. F. <adr...@uo...> - 2006-11-29 00:07:01
|
Milan Babuskov wrote: > Hi Claudio, > > Claudio Valderrama C. wrote: > >> Since SQL allows to order by a field that doesn't appear in the SELECT list >> (and I can't remember any restriction due to DISTINCT, do you see one in the >> docs?) >> > > Suppose you have a table: > > X Y > --- --- > 1 3 > 1 5 > 2 4 > > What should the following query return: SELECT DISTINCT X ORDER BY Y? > > 1 > 2 > > or > > 2 > 1 > DISTINCT act like an aggregate (MS Access has a FIRST aggregate function) causing many rows to become one. So I think is not wrong to reject this query, like it's rejected when aggregate functions are used. Adriano |