1.1、SELECT * FROM 表名 t WHERE 1=1 AND to_date(t.tkdat,'yyyy/MM/dd')
between to_date('2017/8/1','yyyy/MM/dd') and to_date('2017/11/1','yyyy/MM/dd')
1.2、SELECT * FROM zsd018a t WHERE 1=1 AND to_date(t.tkdat,'yyyy/MM/dd hh24:mi:ss')
between to_date('2017/8/1','yyyy/MM/dd hh24:mi:ss') and to_date('2017/11/1','yyyy/MM/dd hh24:mi:ss')
2、当时间条件为date类型的时候,通过以下方法查询数据:
select * from zmm028 where to_char(tkdat,'YYYY-MM-DD')>='2017-10-01'
and to_char(tkdat,'YYYY-MM-DD')<='2017-11-02'
SELECT * FROM dbo.TB_Person WHERE TjryID='15043806127'and adddatetime >='2017-7-1' and adddatetime <='2017-7-31 23:59:59'
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)