Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> How do I select distinct from duplicated records and order by other column?
I have a set of records TableA as
col1 col2 col3 col4
1 D AA D4 2 B BB B4 3 C CC C4 4 A DD A4 2 B BB B4
I can not use the
select distinct(col1), col2, col3, col4
from tableA
where ..
order by col2; <-- Can be changed dynamically?
It generates an error that " not onSelect expression" due to the col#
that order by is not constant.
And I can not put every columns in a group by either. So soes anyone
have a good suggestion? Thanks.
C Chang Received on Mon Apr 22 2002 - 20:27:35 CDT