Run Code
|
API
|
Code Wall
|
Misc
|
Feedback
|
Login
|
Theme
|
Privacy
|
Patreon
Query to remove the string between two indexes of delimiters
-- Query to remove the string between two indexes of delimiters DECLARE @NameString VARCHAR(MAX) = 'Suman,Saurav,Rajeev,Chandra,Mizan,Ahmed', @StartIndex INT = 0, @EndIndex INT = 21 SELECT STUFF(@NameString, CHARINDEX(',', @NameString, @StartIndex), CHARINDEX(',', @NameString, @EndIndex) - CHARINDEX(',', @NameString, @StartIndex), '')
run
|
edit
|
history
|
help
0
New
Cristina
Ranking
Create Tables_2
test
using lead() and sum() with over() in mssql
Demo
TestTable
Pro DB's project
BC160400549