您的位置:首页 > 数据库 > Oracle

oracle格式代码出现两次,文字与格式字符串不匹配

2013-07-22 17:40 393 查看
不报错:

select count(*) as col_0_0_

from scott.kk_sap_main kksapmain0_

where to_date(kksapmain0_.fd_time, 'yyyy-MM-dd HH:mm:ss') >=

'2013-07-09 00:00:00'

and (to_date(kksapmain0_.fd_time, 'yyyy-MM-dd HH:mm:ss') >=

'2013-07-24 23:59:59')

报文字与格式字符串不匹配:

select count(*) as col_0_0_

from scott.kk_sap_main kksapmain0_

where to_date(kksapmain0_.fd_time, 'yyyy-MM-dd HH:mm:ss') >=

'2013-07-09 00:00:00'

and (to_date(kksapmain0_.fd_time, 'yyyy-MM-dd HH:mm:ss') <=

'2013-07-24 23:59:59')

报格式代码出现两次:

select count(*) as col_0_0_

from scott.kk_borrow_main kkborrowma0_

where kkborrowma0_.doc_status <> '10'

and to_date(kkborrowma0_.doc_create_time, 'yyyy-MM-dd HH:mm:ss') >=

to_date('2013-07-05 17:24:00', 'yyyy-MM-dd HH:mm:ss')

and to_date(kkborrowma0_.doc_create_time, 'yyyy-MM-dd HH:mm:ss') >=

to_date('2013-07-31 17:24:59', 'yyyy-MM-dd HH:mm:ss')

正确方法:

select count(*) as col_0_0_

from scott.kk_sap_main kksapmain0_

where to_date(kksapmain0_.fd_time, 'yyyy-MM-dd HH:mm:ss') >=

'2013-07-09 00:00:00'

and kksapmain0_.fd_time <= '2013-07-24 23:59:59'
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: