sql server 多列转多行实现方法

时间:2022-07-03 10:27:41

select * from b_workOrder

select * from( SELECT work_order_id,work_level, roles,code
FROM
(SELECT work_order_id,work_level,operator_code,sqc_code,hqc_code
FROM b_workOrder where sqc_code <>'') p
UNPIVOT
(code FOR roles IN (operator_code,sqc_code,hqc_code))
AS unpvt) as asql server 多列转多行实现方法sql server 多列转多行实现方法