Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: select distinct on computed column
Komix Hui wrote:
>
> Alvin Sylvain wrote:
> >
> > 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.
>
> One Simple Way is:
>
> CREATE VIEW V_CategoryTable(NameType) AS
> SELECT Name||' '||Type
> FROM CategoryTable;
>
> and then,
>
> SELECT DISTINCT NameType
> FROM V_CategoryTable;
Thanks! I did try something like this, and it seemed to work.
Why it should be any different, and why it's different from Sybase, remains much of a mystery.
A. Received on Thu Jan 09 1997 - 00:00:00 CST