在Oracle的to_char中转义非格式字符的最佳方法是什么?

时间:2021-12-16 15:47:40

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

我试图在select语句中打印日期,但我需要在输出中添加一个字母:

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?

Oracle不喜欢T.我只想让T像冒号和破折号一样输出。我可以用反斜杠或其他东西逃脱吗?

1 个解决方案

#1


62  

You just need double-quotes around it:

你只需要双引号:

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

#1


62  

You just need double-quotes around it:

你只需要双引号:

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