Oracle FAQ Your Portal to the Oracle Knowledge Grid
HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US
 

Home -> Community -> Usenet -> c.d.o.server -> Re: Solved! I think (Re: select distinct on computed column)

Re: Solved! I think (Re: select distinct on computed column)

From: Charles Jardine <cj10_at_cam.ac.uk>
Date: 1997/01/09
Message-ID: <32D4D1D6.6F9F@cam.ac.uk>#1/1

Alvin Sylvain wrote:
>
 

> My failing query read something like the following:
>
> select distinct alias || ' ' || name "thename"
> from personview
>
> and received the 1791 error. W/O the "distinct" it was kool.

We might all get somewhere if you would post the *actual* failing query, rather than 'something like' it.

The manual says that 1791 indicates an error in the ORDER BY clause of a SELECT DISTINCT query. Either Oracle is broken or your actual failing query had an ORDER BY clause.

There is a perfectly sensible restriction on ORDER BY in SELECT DISTINCT queries. To quote the manual again:

 If the ORDER BY clause and the DISTINCT operator both appear  in a SELECT statement, the ORDER BY clause cannot refer  to columns which do not appear in the select list.

Useful things - these manuals! Received on Thu Jan 09 1997 - 00:00:00 CST

Original text of this message

HOME | ASK QUESTION | ADD INFO | SEARCH | E-MAIL US