ANSI SQL 92: find last occurrence of character

强颜欢笑 提交于 2019-12-12 23:14:58

问题


I need a ANSI SQL 92 statement to change all characters following the last '/' character to lower case.

On Sybase I would write:

update table 
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.

来源:https://stackoverflow.com/questions/7241090/ansi-sql-92-find-last-occurrence-of-character

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!