Oracle FAQ | Your Portal to the Oracle Knowledge Grid |
![]() |
![]() |
Home -> Community -> Usenet -> c.d.o.server -> Re: HELP - Order by problem
First a some observations:
Now for an answer:
Oracle (sql*plus) is expecting the ')' before the 'order by' since the parser recognizes that the sub-query can only return one row.
Now a solution:
> SQL> update conv_observation_tables cot set ( person_id,role_type ) =
> 2 ( select person_id, role_type
> 3 from spi_survey_surveyors s1
> 4 where s1.spi_project_dc_id = cot.spi_project_dc_id
> 5 and person_id = (select min(person_id) from
spi_survey_surveyors s2
> 6 where s2.spi_project_dc_id =
cot.spi_project_dc_id))
> 7 where observation_line_id = 4180;
Keith McKendry
Whittman-Hart, Inc.
EXE wrote:
> > I'm using Oracle server 7.3.3.0.0 Why am I getting the
> > following error in sql/plus
> >
> > SQL> update conv_observation_tables cot set ( person_id,role_type )
=
> > 2 ( select person_id, role_type
> > 3 from spi_survey_surveyors s1
> > 4 where s1.spi_project_dc_id = cot.spi_project_dc_id
> > 5 and rownum < 2
> > 6 order by 1, 2 )
> > 7 where observation_line_id = 4180;
> > order by 1, 2 )
> > *
> > ERROR at line 6:
> > ORA-00907: missing right parenthesis
>
>
![]() |
![]() |