tp6中oracle怎么通過日期查詢,怎么處理todate()
發布日期:2022-03-12瀏覽次數:610 來源:福州網站建設 標簽: tp6
oracle
todate
日期
oracle的原生語句:select * from aa_table f
where
and f.fee_time >= to_date('2022-1-22', 'yyyy-mm-dd')
and f.fee_time < to_date('2022-1-22', 'yyyy-mm-dd') + 1;
如果用tp6的寫法,加上日期就會查出報錯,取消日期就可查,試了幾個辦法都不行。
$rz=Db::table('aa_table')->where([
['fee_time','>', "to_date('2022-1-22', 'yyyy-mm-dd')"],
['fee_time','>', "to_date('2022-1-23', 'yyyy-mm-dd')"]
])->select();
報錯如下:
SQLSTATE[HY000]: General error: 1858 OCIStmtExecute: ORA-01858: a non-numeric character was found where a numeric was expected
(/usr/local/src/php-7.2.21/ext/pdo_oci/oci_statement.c:159
。
請教一下,這個日期,todate()應該怎么處理。怎么加上日期來查詢。
以上是由福州網站建設的小編為你分享了"tp6中oracle怎么通過日期查詢,怎么處理todate()"文章,如果你在這方面有什么問題,隨時聯系我們
網友評論
-
ぺ灬紫夜 03月24日
whereExp('CREATE_TIME',">TO_DATE('2021-01-01 00:00:00', 'YYYY-MM-DD HH24:MI:SS')")
-
yzh52521 03月11日
whereRaw('fee_time > to_date('2022-1-22', 'yyyy-mm-dd'))