mybatis + oracle xml里面时间段查询sql写法,我的sql运行之后传的时间是null
selectsubstr(OURNUMBER,instr(OURNUMBER,'*',-1)+1,4)yhkh,to_char(AMOUNT,'9999999999.99...
select substr(OURNUMBER,instr(OURNUMBER,'*',-1)+1,4) yhkh, to_char(AMOUNT, '9999999999.99') jyje, to_char(CREATETIME,'yyyymmdd') jyri from OP_PAYWAYDETAIL where CREATETIME >= #{to_date(jyri),jdbcType=VARCHAR} and CREATETIME < #{to_date(jyri,jdbcType=VARCHAR}
展开
1个回答
2016-09-01
展开全部
select
substr(OURNUMBER,instr(OURNUMBER,'*',-1)+1,4) yhkh,
to_char(AMOUNT, '9999999999.99') jyje,
to_char(CREATETIME,'yyyymmdd') jyri
from
OP_PAYWAYDETAIL
where
CREATETIME >= to_date(#{jyri,jdbcType=VARCHAR}) and CREATETIME < to_date(#{jyri,jdbcType=VARCHAR})
substr(OURNUMBER,instr(OURNUMBER,'*',-1)+1,4) yhkh,
to_char(AMOUNT, '9999999999.99') jyje,
to_char(CREATETIME,'yyyymmdd') jyri
from
OP_PAYWAYDETAIL
where
CREATETIME >= to_date(#{jyri,jdbcType=VARCHAR}) and CREATETIME < to_date(#{jyri,jdbcType=VARCHAR})
更多追问追答
追问
to_date(?) and CREATETIME < to_date(?)不对哦
追答
CREATETIME >= to_date(#{jyri,jdbcType=VARCHAR},'MM-DD-YYYY') and CREATETIME < to_date(#{jyri,jdbcType=VARCHAR},'MM-DD-YYYY')
本回答被提问者和网友采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询