Re: isql detail table update?
Posted in 1993
Topics: SQL Development & Query Writing
In article <CGGnwp.4G5@perk.jpr.com> news@perk.jpr.com writes: >Table schemas: >-------------- >create table "root".atkliquh # HEADER Table > ( > *tk_num integer not null, > c_num char(6), > job_num integer, ... > inv_num char(10) > ); >create table "root".atkliqud # DETAIL Table > ( > *tk_num integer not null, > *item_num smallint, ... > ); > >Question >-------- >In the above header --> detail tables I need to do an isql update on the >detail table using a subquery and don't know how to do it. Here's the >algorithm of what I would like to do: > >update atkliqud > set unit_type = "Sludge" > where atkliquh.job_num = 100 and > atkluquh.tk_num = atkliqud.tk_num > Try this:- update atkliqud set unit_type = "Sludge" where atkliqud.tk_num in ( select atkliquh.tk_num from atkliquh where atkliquh.job_num = 100 ); -- +-----------------------------------+---------------------------------+ | Malcolm McLean | mmclean@ipaedin.demon.co.uk | | Image Partnering Associates Ltd | 100025,1543@compuserve.com | | 4 Dalgety Avenue | |\\___/| | | Edinburgh | (_O O_) | | EH7 5UE Voice 031-661 9180 | /(V)\\ | +-----------------------------------+---------------------------------+