如何创建一个读取所有Status_Jobs状态的计算字段,如果所有状态都在" COMPLETE"
然后Status_Project更改为"已完成"
但是如果在" INCOMPLETE"
中有Status_Jobs的记录Status_Project " INCOMPLETE"
由于
答案 0 :(得分:0)
试试这个,
declare @Status varchar(50)
if (Select count(*) from tablename where Status_Project ='Completed')=(Select count(*) from tablename)
set @Status='Completed'
ELSE
set @Status='InCompleted'
update tablename set Status=@Status