Re: sub query in sql update
Posted in 1994
In article <36pah6$bo2@masala.cc.uh.edu> SDowdy@uh.edu (Steve Dowdy) writes:
>
>
>I am having trouble with sub-queries on an update statement. I keep
>getting a message the the sub-query returned more than exactly one row.
>As a work around I tried the following:
>
>select unique TRANS_ACCOUNT from TRANS
>where .....
>into temp x;>
>update FRS set>FRS_FREEZE = "Y"
>where FRS_ACCOUNT = select x.TRANS_ACCOUNT from TRANS;
>
>Again, I get the message that the sub-query returned more than exactly
>one row. Does the "unique" qualifier not give me a unique row?
>
>Any help?
>
>SDowdy@uh.edu
Your query should be,
update FRS setFRS_FREEZE = "Y"
where FRS_ACCOUNT in ( select x.TRANS_ACCOUNT from TRANS ) ;
--
Yagnesh M Mehta | ymehta@harriet.rencorp.com
REN Corporation USA | (615) 353-4145