sql陳述句為:
select * from cxhnweixin.FPV_FARM_PAY_VOUCHER
where status ='finish'
and to_char(finish_time,'yyyy-MM-dd') >= to_char(to_date('${starttime}','yyyy-MM-dd'))
and to_char(finish_time,'yyyy-MM-dd') < to_char(to_date('${endtime}','yyyy-MM-dd'))
資料庫沒有刷選出資料,為空白,其中資料庫里格式為2020-01-01 00:00:00.0的樣式,請問各位大佬這條陳述句哪里有問題,該怎么改呢,謝謝
uj5u.com熱心網友回復:
兩個時間的條件沖突嗎?建議都轉成時間進行對比
uj5u.com熱心網友回復:
已經解決了select * from cxhnweixin.FPV_FARM_PAY_VOUCHER
where status ='finish'
and finish_time >= cast(to_date('${starttime}','yyyy-mm-dd hh24:mi:ss') as timestamp)
and finish_time < cast(to_date('${endtime}','yyyy-mm-dd hh24:mi:ss') as timestamp)
order by finish_time
轉載請註明出處,本文鏈接:https://www.uj5u.com/shujuku/8417.html
標籤:基礎類
上一篇:Mysql
下一篇:新人finereport求助
