Home » SQL & PL/SQL » SQL & PL/SQL » Why is this Error???  () 1 Vote
Why is this Error??? [message #193028] Thu, 14 September 2006 10:31 Go to next message
cgk1983
Messages: 28
Registered: December 2005
Junior Member
This is the sample table

SQL> select * from ft1;

COL1 COL2
---------- ----------
1 a
2 b
3 c
d
5 fd
6 dfsdfsdf
7 qw
1 a
2 b
3 c
d

COL1 COL2
---------- ----------
5 fd
6 dfsdfsdf
7 qw

14 rows selected.

SQL> select col2 from ft1 where col1 in (select distinct(col1) from ft1 order by col1);
select col2 from ft1 where col1 in (select distinct(col1) from ft1 order by col1)
*
ERROR at line 1:
ORA-00907: missing right parenthesis
Re: Why is this Error??? [message #193034 is a reply to message #193028] Thu, 14 September 2006 10:43 Go to previous messageGo to next message
Frank
Messages: 7880
Registered: March 2000
Senior Member
you cannot use order by in an IN subselect.
It doesn't make sense anyway, just as the distinct does not make any sense.
Re: Why is this Error??? [message #193038 is a reply to message #193034] Thu, 14 September 2006 11:27 Go to previous message
cgk1983
Messages: 28
Registered: December 2005
Junior Member
ya u r correct Thanks
Previous Topic: Reference a variable
Next Topic: packages
Goto Forum:
  


Current Time: Mon Dec 05 21:05:23 CST 2016

Total time taken to generate the page: 0.10397 seconds