路就是把传入的字符串转换成一个table, 见代码

DECLARE @tempTable table(F1 nvarchar(20))

DECLARE @ch nvarchar(20)

DECLARE @PlanningCrewIDS nvarchar(200)

set @PlanningCrewIDS = '1,2,3,4,'

 

                WHILE(@PlanningCrewIDS <>'')

                    BEGIN

                        SET @ch = LEFT(@PlanningCrewIDS,Charindex(',',@PlanningCrewIDS,1) -1)

                         INSERT @tempTable values(@ch)

                         SET @PlanningCrewIDS = stuff(@PlanningCrewIDS,1,Charindex(',',@PlanningCrewIDS,1),'')

                     END

 

SELECT FROM Candidate where IDPlanningCrew in(SELECT F1 FROM @tempTable)

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2021-10-04
  • 2021-11-29
  • 2021-06-25
  • 2021-07-19
  • 2021-11-25
猜你喜欢
  • 2021-06-14
  • 2022-12-23
  • 2021-06-02
  • 2021-06-18
  • 2021-11-10
  • 2022-03-07
相关资源
相似解决方案