sql server - Trimming alphanumeric characters from a strings of varying lengths in T-SQL -


I have a result that I want to trim 2 points suffix The strings will always be of different lengths, but the suffix will always be two digits separated by '-'.

Example:

APPTR-W302-01
NRSB-8920-09

Right now I am using the following: It is a hack Because '20' parameter is irregular.

  reverse (SUBSTRING (REVERSE (COURSENAME, 4,20))  

What is a better way?

Will the suffix always be '- ##'? If the suffix length does not change, then

  left (Korean, LAN (Korean) -3)  

Comments

Popular posts from this blog

c# - ListView onScroll event -

PHP - get image from byte array -

Linux Terminal Problem with Non-Canonical Terminal I/O app -