sql 使用变量带入in条件
DECLARE @defect_condition_TB TABLE (DefectName NVARCHAR(100)); INSERT INTO @defect_condition_TB (DefectName) VALUES (N'耐久'), (N'光学测定'); SELECT DefectName FROM @defect_condition_TB select * from T_VP_Defect_DefectMonthlyDetailsList_Orig where process_name in(SELECT DefectName FROM @defect_condition_TB)