我该如何在Oracle数据库中表示时间?

时间:2016-09-18 16:20:02

标签: oracle time format

我想存储一天中的时间 - 例如18:00在Oracle数据库中,并希望用它做比较查询。

表示时间列的推荐方法是什么?

1 个答案:

答案 0 :(得分:1)

您可以使用带有日期时间错字的列,因此您可以对datetime列执行比较并使用to_char(datetime)显示时间 http://docs.oracle.com/cd/B19306_01/server.102/b14200/functions180.htm

例如:

• Illegal nested type family application ‘1 + Length as’
  (Use UndecidableInstances to permit this)
• In the equations for closed type family ‘Length1’
  In the type family declaration for ‘Length1’

格式模型请参阅http://docs.oracle.com/cd/B19306_01/server.102/b14200/sql_elements004.htm