Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
Home -> Community -> Usenet -> c.d.o.misc -> Re: SQL question
FlameDance wrote:
> Hi everyone,
>
> why does one of these very similar statements work and the other doesn't?
>
> SQL> select distinct fa20, '2' from t_2;
>
> FA20 '
> ---------- -
> 0 2
> 1 2
> 2 2
> 3 2
> 4 2
> 5 2
>
> 6 Zeilen ausgewõhlt.
>
> SQL> select '2', distinct fa20 from t_2;
> select '2', distinct fa20 from t_2
> *
> FEHLER in Zeile 1:
> ORA-00936: Ausdruck fehlt
>
> The error text translates to: Expression missing
>
> Very curious,
> Stephan
Because you can't stick the keyword DISTINCT anywhere you feel like it.
-- Daniel Morgan http://www.outreach.washington.edu/ext/certificates/oad/oad_crs.asp http://www.outreach.washington.edu/ext/certificates/aoa/aoa_crs.asp damorgan_at_x.washington.edu (replace 'x' with a 'u' to reply)Received on Wed Jun 23 2004 - 19:30:13 CDT