update table2
set xxx = case when not exists (select 'X' from table1 where status1) then 1
when not exists (select 'X' from table1 where status2) then 2
else 3 end
试试吧,不知道对不对
update table2
set xxx = case when not exists (select 'X' from table1 where status1) then 1
when not exists (select 'X' from table1 where status2) then 2
else 3 end
试试吧,不知道对不对