ANSI SQL 92: find last occurrence of character
I need a ANSI SQL 92 statement to change all characters following the last '/' character to lower case.
On Sybase I would write:
update t开发者_JAVA百科able
set col = left(col, len(col)-charindex('/', reverse(col))) ||
lower(right(col, charindex('/', reverse(col))))
I can find all functions in ANSI SQL 92 but the REVERSE function, that I just use to find the last occurrence of the slash.
精彩评论