@m869485074:
select SERTIAL,
case when count(case when PROCESS_SERTIAL = 1 and PLANSTATUS = 2 then 1 else null end) > 0 then '√' else '' end 序号1,
case when count(case when PROCESS_SERTIAL = 2 and PLANSTATUS = 2 then 1 else null end) > 0 then '√' else '' end 序号2,
case when count(case when PROCESS_SERTIAL = 3 and PLANSTATUS = 2 then 1 else null end) > 0 then '√' else '' end 序号3,
case when count(case when PROCESS_SERTIAL = 4 and PLANSTATUS = 2 then 1 else null end) > 0 then '√' else '' end 序号4
from (select t.cardno,t.serial,t.process_serial,t.planstatus as planstatus
from MT_PL_ORDER_PRODUCT_CARD_H t
where t.cardno in (select t.cardno
from MT_PL_ORDER_PRODUCT_CARD_M t
where t.process_ver = '1606067-1_1')
order by t.cardno,t.process_serial) t
group by SERTIAL