Communities for your favorite technologies. Explore all Collectives
Ask questions, find answers and collaborate at work with Stack Overflow for Teams.
Ask questions, find answers and collaborate at work with Stack Overflow for Teams. Explore Teams
Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
column1 \\abc\tri\eds\rf1\edr\4ed \\f.d\tri\ef\poe \\ghi0j\tri\gf\rf\k\hg\ose
' ' '
i got some rows like that in a column
now i want to get the result set like
\\abc\tri\eds \\f.d\tri\ef\ \\ghij\tri\gf
simply from first '\' to end of 4th '\'
In this week's episode of Horrible Code I Have Written For StackOverflow...
SELECT SUBSTRING(column1, 1, CHARINDEX('\', column1, CHARINDEX('\', column1, CHARINDEX('\', column1, 3) + 1) + 1)) FROM TableName
Add a comment
Start asking to get answers
Find the answer to your question by asking.
Explore related questions
See similar questions with these tags.