This should be an easy question, but I rarely mess with SQL.
I need to update the results from the following query:
select *
from table 1, table 2
where table1.field_ID = table2.field_ID
and table2.field_flag = 'y'
My problem is I can't get the syntax to update a field in table 2 above based on that criteria, but it's not working. In theory, this is what I need to do:
update table2
set table2.field = 999
where
(select *
from table 1, table 2
where table1.field_ID = table2.field_ID
and table2.field_flag = 'y')
Can anyone help me out? Thanks!
I need to update the results from the following query:
select *
from table 1, table 2
where table1.field_ID = table2.field_ID
and table2.field_flag = 'y'
My problem is I can't get the syntax to update a field in table 2 above based on that criteria, but it's not working. In theory, this is what I need to do:
update table2
set table2.field = 999
where
(select *
from table 1, table 2
where table1.field_ID = table2.field_ID
and table2.field_flag = 'y')
Can anyone help me out? Thanks!