Re: Query question

From: Jack S. Moore <rpi_at_crl.com>
Date: 22 Apr 1994 12:24:45 -0700
Message-ID: <2p989t$c9i_at_crl2.crl.com>


In article <1994Apr21.181129.15056_at_arco.com>, Gary Meyers <dbsgrm_at_arco.com> wrote:
>
>update temp_results tr
>set (mean,stdev) =
>(select avg(temp),stddev(temp)
>from station s,temp t
> where s.station_id = t.station_id
>and s.station_id in (select station_id from station)
>and yr between '1976' and '1987'
>group by s.station_id)
>where tr.station_id in (select station_id from station)
>
>I know the select avg(temp),stddev(temp) part works, but I am, of course, getting a
>
>"ORA-01427: single-row subquery returns more than one row" error.
>
>Thanks for the help, folks.
>--
>Gary Meyers : Usual disclaimer here
>gary.meyers_at_Edm.Arco.COM : My opinions, etc. etc.
>
>

TRY: update temp_results tr
set (mean,stdev) =
(select avg(temp),stddev(temp)
from station s,temp t
where s.station_id = t.station_id
and s.station_id = tr.station_id
and yr between '1976' and '1987'
) Received on Fri Apr 22 1994 - 21:24:45 CEST

Original text of this message