日期:2014-05-17 浏览次数:20723 次
select AppNo,ClientName,
(select case when AppNo<>'' then '已执行' else '未执行' end from OPA where appno=apply.appno) as '流程A',
(select case when AppNo<>'' then '已执行' else '未执行' end from OPB where appno=apply.appno) as '流程B'
from apply
select?AppNo,ClientName,
(select?case?when?isnull(AppNo,'')<>''?then?'已执行'?else?'未执行'?end?from?OPA?where?appno=apply.appno)?as?'流程A',
(select?case?when?isnull(AppNo,'')<>''?then?'已执行'?else?'未执行'?end?from?OPB?where?appno=apply.appno)?as?'流程B'
?from?apply
select a.AppNo,a.ClientName,case when ISNULL(b.appno,'')<>'' then '已执行' else '未执行' end as '流程A',
case when ISNULL(c.appno,'')<>'' then '已执行' else '未执行' end as '流程B',
from apply a left join opa b on a.appno=b.appno
left join opb c on a.appno=c.appno
select a.AppNo,a.ClientName,case when ISNULL(b.appno,'')<>'' then '已执行' else '未执行' end as '流程A',
case when ISNULL(c.appno,'')<>'' then '已执行' else '未执行' end as '流程B'
from apply a left join opa b on a.appno=b.appno
left join opb c on a.appno=c.appno