Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: select distinct on computed column
Jim Smith wrote:
>
> In article <32D2C414.1A93_at_c-square.no.junk>, Alvin Sylvain <alvin_at_c-
> square.no.junk> writes
> >I'm converting an application from Sybase to Oracle and I've run
> >into a number of quandries.
> >
> >This one is performing a "distinct" select on a "computed" column.
> >
> >Eg:
> >
> > select distinct name || ' ' || type "nametype"
> > from categorytable
> >
> >Sybase allowed this, altho Oracle seems to not.
>
> What error are you getting? This is perfectly valid.
You're right, I tried on the EMP table under the "scott/tiger" account, and it worked fine.
The error I get is:
1791, not a SELECTed expression.
When I try this from sqlplus, it marks the first || with an asterisk. It has no complaint without the "distinct".
Altho, in trying to reproduce the problem, I've just noticed that it's being performed on a view vs. a base table, so before I continue I'll have to find out what the view-select is doing. That might explain the problem.
It's a peculiarity that never cropped up in Sybase.
A. Received on Wed Jan 08 1997 - 00:00:00 CST