I`m trying to substring up to specific length. For example string length is 100. I need to cut the string at 31 characters but not to cut whole words.
PARTNER ESSENTIAL 24 MONTHS INITIAL FOR NETBACKUP SELF SERVICE XPLAT
If I simply split aft 31 characters the outcome is that the first part is PARTNER ESSENTIAL 24 MONTHS INI
and the second part is TIAL FOR NETBACKUP SELF SERV
, with the word INITIAL
split. I need to end on ... 24 MONTHS
and put the whole of the word INITIAL
into the second part.
So I need to separate the string up to the last space to make this clear and understandable. One more thing this need to be executed in one single query.