oracle数据库查询日期类型字段


说明:数据库的字段为日期类型

操作:

第一种方式将字符串日期转换成date类型,用到函数to_date,方式如下:

select d.s_info_windcode from CBONDDESCRIPTION d where d.is_failure =   0 and 

and opdate = to_date('2018/12/26 11:06:29','yyyy/mm/dd hh24:mi:ss')

第二种方式将字段转换成字符格式,用到函数to_char,方式如下:

select d.s_info_windcode from CBONDDESCRIPTION d where d.is_failure =   0 and 

and to_char(opdate,'yyyymmdd hh24:mm:ss') = '20181226 11:06:29'

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM