开发者

ANSI SQL 92: find last occurrence of character

开发者 https://www.devze.com 2023-04-01 12:04 出处:网络
I need a ANSI SQL 92 statement to change all characters following the last \'/\' character to lower case.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消