在数据库中查询一段时间内的数据,SQL语句怎么写

2025-03-20 11:46:19
推荐回答(1个)
回答1:

select ex.* from EX_SUB_BILLS ex
where to_char(ex.create_time, 'yyyy-MM-dd') >= '2017-10-16'
and to_char(ex.create_time, 'yyyy-MM-dd') <= '2017-10-25'
要注意时间的类型,我这里为String类型。