Distinct in query results in wrong order by
From: Roelof <r.pit_at_raadvanstate.nl>
Date: 19 Jun 2003 06:08:02 -0700
Message-ID: <f602866b.0306190508.32251450_at_posting.google.com>
Date: 19 Jun 2003 06:08:02 -0700
Message-ID: <f602866b.0306190508.32251450_at_posting.google.com>
We have query like this
select distinct to_char(date_column, 'day dd mm yyyy')
It runs OK without the distinct. But with distinct it returns "not a
selected expression". The next query runs. But it sorts om the name of
the days insted of the date_column value as intended.
select distinct to_char(date_column, 'day dd mm yyyy')
, next column
from table
order by date_colum
, next column
from table
order by to_char(date_column, 'day dd mm yyyy')
Help would be highly appreceated.
Roelof Received on Thu Jun 19 2003 - 15:08:02 CEST