关于oracle时间转换的一个小小疑问


select rownum ro,
q.que_id,
q.lib_id,
q.que_code,
q.type_code,
q.base_code,
q.diff_code,
q.knowledge_id,
q.ability_code,
q.create_user,
q.create_time,
q.is_big_text,
q.parent_id,
q.que_version,
q.casual,
q.choise,
q.answer,
q.clob_casual,
q.clob_choise,
q.clob_answer,
q.score,
q.answer_time,
q.source_code,
q.source_code as sourceName,
q.use_count,
q.is_approved,
q.is_avail,
q.start_time,
q.end_time,
q.byinfor,
q.update_time,
q.update_user,
(select dir_name from directorys where dir_id = q.lib_id) as lib_name,
(select type_name from question_type where type_code = q.type_code) as type_name,
(select diff_name
from question_difficulty
where diff_code = q.diff_code) as diff_name,
(select qk_name
from question_knowledge
where knowledge_id = q.knowledge_id
and type_code = 'K') as qk_name,
(select ability_name
from question_ability
where ability_code = q.ability_code) as ability_name,
secret
from questions q
where (end_time >= to_date('2016-09-20 09:54:03.375','YYYY-MM-DD HH24:MI:SS.FF3') or end_time is null)
and is_avail = 'Y'
and is_approved = 'Y'
and parent_id = -1
and q.que_id not in (select impl_que_id
from part_question
where partition_id in
(select pp.partition_id
from paper_partition pp
where pp.partition_exam_paper = 530501)
and impl_que_id is not null)
and is_deleted = 'N'
/*不注释这一行能执行,注释掉就报错*/
/*and (exam_wh_id in (-11716325) or exam_wh_id = 11716325)*/
and is_course = 'Y'
order by update_time desc


[img]http://dl2.iteye.com/upload/attachment/0120/1440/d16d2a46-e4ac-3f5b-a45f-61a59690b392.png[/img]

整个sql语句就用到了这么一个时间转换的地方,尚未发现有什么问题,过段时间再仔细研究一下。
to_date('2016-09-20 09:32:34.382','yyyy-MM-dd HH24:mi:ss.ff3')


[size=large][color=blue][b]难道是因为下面的条件已经把数据都筛选没了,而时间那个条件还没来得及执行?[/b][/color][/size]
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值