I need this string to split after the first '-' as follows:
DISPLAY VALUE
466500-GO-INF-ITAPPS-EMP-CLERADM
DISPLAY VALUE2
GO-INF-ITAPPS-EMP-CLERADM
I've tried substring and charindex with no success.
I think stuff()
is convenient for this:
select stuff(value, 1, charindex('-', value), '')