sql - Updating both rows and columns in oracle -
can rows upadted along colums table.
had table amount updated single member 3 different years
i used following query
update ahd set amount1=(select a.amnt1 ahd inner join ahdtmp on ahd.member_key=a.member_key ahd.date1=a.date1 , a.status='false' , a.member_key in (select distinct member_key ahd))
when execute this
error @ line 2:
ora-01427: single-row subquery returns more 1 row
the temporary table ahdtmp
create table ahdtmp( member_key number(10), date1 date, amnt1 number(10,2), amnt2 number(10,2), date_amend date, status varchar2(10));
please suggest on this?
what have gone wrong..
possibly want is:
update ahd set amount1=(select a.amnt1 ahdtmp ahd.member_key=a.member_key , ahd.date1 =a.date1 , a.status='false') member_key = 'some particlar member ey'
Comments
Post a Comment