







update t_operation
set t_operation.isrestrictionenabled = '1'
from t_operation a,t_operation b
where a.opid = b.opid and a.opno = (select convert(int,opno)-5 from t_operation c where c.opname = '回火' and c.opid = b.opid)
select convert(varchar,convert(int,opno)-5) from t_operation c
where c.opname = '回火' and c.opid = t_operation.opid
select convert(int,b.opno) from t_operation b
update t_operation
set isrestrictionenabled = '1' where opid in (
select opid from t_operation where opid in (
select routingid,convert(varchar,convert(int,opno)-5) from t_operation where opname = '回火'))
select * from t_operation where opname = '感应淬火' order by routingid,opno
-- 方法一:
update t_operation
set isrestrictionenabled = '1'
where t_operation.opno = (select convert(varchar,convert(int,c.opno)-5) from t_operation c
where c.opname = '回火' and c.routingid = t_operation.routingid and t_operation.opno+5 = c.opno)
-- 方法二:
update t_operation
set isrestrictionenabled = '1' where opid in (
select opid from t_operation a,
(select c.routingid,convert(varchar,convert(int,c.opno)-5) as opno from t_operation c where c.opname = '回火') as b
where a.routingid = b.routingid and a.opno = b.opno)
-- 方法三:
update t_operation
set IsRestrictionEnabled='1'
where opid in
(
select t.opid
from t_operation t
inner join (select routingid,(Convert(int,opno)-5) as opno from t_operation where opName='回火') as a on t.routingid=a.routingid and t.opno=a.opno
)
此内容由惯性聚合(RSS阅读器)自动聚合整理,仅供阅读参考。 原文来自 — 版权归原作者所有。