SQLSERVER类似于lastindexof的语句

select REVERSE(SUBSTRING(REVERSE(test),0,CHARINDEX('-',REVERSE(test)))) from tmp

备注:其中reverse代表反转的意思

原文地址:https://www.cnblogs.com/no27/p/14261299.html