What is the best way to escape non-format characters in Oracle's to_char?

十年热恋 提交于 2019-11-27 13:27:18

问题


I am trying to print a date in a select statement, but I need to add a letter to the output:

to_char(date_updated, 'YYYY-MM-DDTHH:mm:ss')

Oracle does not like the T. I just want the T to be output like the colons and the dashes. Can I escape it with a backslash or something?


回答1:


You just need double-quotes around it:

to_char(date_updated, 'YYYY-MM-DD"T"HH:mm:ss')


来源:https://stackoverflow.com/questions/588430/what-is-the-best-way-to-escape-non-format-characters-in-oracles-to-char

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