格式化 INTERVAL DAY(0) 到 SECOND(0) [英] Formatting INTERVAL DAY(0) TO SECOND(0)
本文介绍了格式化 INTERVAL DAY(0) 到 SECOND(0)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有几个时间字段是 INTERVAL DAY(0) TO SECOND(0) 数据类型来存储一天中的不同时间.
I have a few time fields that are INTERVAL DAY(0) TO SECOND(0) Datatypes to store various times of the day.
目前在正常检索中,我的字段显示如下:
Currently on normal retrieval, my fields display as such:
+00 19:00:00.000000
+00 19:00:00.000000
我如何设置格式以使其显示为 19:00?
How am I able to format this such that it displays as 19:00?
推荐答案
使用
substr(to_char(interval_value), 5, 5)
其中 interval_value
是列名(顺便说一句,关系数据库中的表没有字段;它们确实有列).
where interval_value
is the column name (incidentally, tables in a relational database don't have fields; they do have columns).
这篇关于格式化 INTERVAL DAY(0) 到 SECOND(0)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文