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()应该怎么处理。怎么加上日期来查询。