I am trying to use the following sql statement to update a table based on values from another table.
Update grid_master_stg gms set gms.grid_key = (select gm.grid_key from grid_master gm where gm.grid_lvl = gms.grid_lvl and gm.grid_type = gms.grid_type and gm.grid_name = gms.grid_name) where exists (select * from grid_master gm where gm.grid_lvl = gms.grid_lvl and gm.grid_type = gms.grid_type and gm.grid_name = gms.grid_name)
The error message I receive is: single row subquery returns more than one row.
I thought you could use "exists" with a subquery that returns multiple rows. I am using c# code and and Oracle 9 database.
Can anyone please help me get this working?
Thanks!!
Update grid_master_stg gms set gms.grid_key = (select gm.grid_key from grid_master gm where gm.grid_lvl = gms.grid_lvl and gm.grid_type = gms.grid_type and gm.grid_name = gms.grid_name) where exists (select * from grid_master gm where gm.grid_lvl = gms.grid_lvl and gm.grid_type = gms.grid_type and gm.grid_name = gms.grid_name)
The error message I receive is: single row subquery returns more than one row.
I thought you could use "exists" with a subquery that returns multiple rows. I am using c# code and and Oracle 9 database.
Can anyone please help me get this working?
Thanks!!