select 合同号,
   max(case when 工序名称='排产' then 工序日期 end) 排产日期,
   max(case when 工序名称='毛坯' then 工序日期 end) 毛坯日期,
   max(case when 工序名称='制扣' then 工序日期 end) 制扣日期,  
   max(case when 工序名称='抛光' then 工序日期 end) 抛光日期,
   max(case when 工序名称='成品' then 工序日期 end) 成品日期,
   max(case when 工序名称='发货' then 工序日期 end) 发货日期
from yourtable group by 合同号