Improve company productivity with a Business Account.Sign Up
where ( ID =23
OR ID = 12
OR ID = 1
OR ID = 5
OR ID = 3
OR ID = 47
Open in new window
At Springboard, we know how to get you a job in data science. With Springboard’s Data Science Career Track, you’ll master data science with a curriculum built by industry experts. You’ll work on real projects, and get 1-on-1 mentorship from a data scientist.
DECLARE @p1 varchar(max)
DECLARE @Splitter char(1)
SET @Splitter = '-'
SET @p1 = '2-3-4-5'
SELECT CAST('<v>' + REPLACE(@p1, @Splitter, '</v><v>') + '</v>' AS XML) AS Split
where (@p1 is null
ID IN (
SELECT cast(x.v.value('.', 'bigint') as bigint) AS Value
CROSS APPLY Split.nodes('//v') x(v)
CREATE TABLE #tmp1 (Val1 INT)
INSERT INTO #tmp1(Val1)
FROM #tmp1 t
WHERE '23-12-1-5-3-47' LIKE '%' + CAST(t.Val1 as VARCHAR) + '%'
Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.
Have a better answer? Share it in a comment.
Please enter a first name
Please enter a last name
Must be at least 4 characters long.
Join and Comment
From novice to tech pro — start learning today.
Premium members can enroll in this course at no extra cost.