摘要:
update table set table.field=( case when 条件 then 值1 else 值2 end )where 条件如:update BM_TrainingPeriod set IsValid=( case when exists(select 1 From BM_TrainingGroup y where BM_TrainingPeriod.id=y.TrainingPeriodid and IsValid=1) then 1 else 0 end ) where id=@TrainingPeriodID 阅读全文