Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.server -> Re: select distinct on computed column
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;
-- Hui, Kwok Miu (Xu, Guo Miao) E-Mail: huikomix_at_dt.com.hk Assistant MIS Manager Tel : (00852)2589 3369 Cho Yang (Hong Kong) Co., Ltd. Fax : (00852)2559 3049Received on Thu Jan 09 1997 - 00:00:00 CST