What is the correct way to get the last word of a part of a varchar?
DECLARE @desc varchar(100)
SET @desc='EXCHANGEUNIT P1i / SILVERBLACK/ CYRILLIC'
SELECT RTRIM(LEFT(@desc, CHARINDEX('/', @desc) - 1))
This returns: EXCHANGEUNIT P1i
I need to get only P1i
with the query.
Thanks in advance.