以下每一句效果都一样:
1、Select * from a where date between to_date('2018-1-1', 'yyyy-mm-dd') and to_date('2018-8-1','如搭yyyy-mm-dd')
2、Select * from a where date between to_date('2018/1/1', 'yyyy/mm/dd') and to_date('2018/8/1','yyyy/mm/dd')
3、Select * from a where date between to_date('2018-1-1', 'yyyy/mm/dd') and to_date('2018/8/1','yyyy-mm-dd'基团)
扩展资料
数据库中Date与DateTime的区别
Date:代表xxxx年xx月xx日 只表示前面的日期,是SQL Server 2008新引进的数据类型。它表示一个日子,不包含时间部分,可以表示的日期范围从公元元年1月1日到9999年12月31日,只需要3个字节的存储空间。
DateTime:代表xxxx年xx月xx日xx时xx分xx秒 精确到时分秒,用于做时间戳,日期和时间部分,可以表示的日期范围从公元1753年1月1日00:00:00.000 到9999年12月31日搏橡橘23:59:59.997 ,精确到3.33毫秒,它需要8个字节的存储空间。