---------- 创建日期时间测试表-----------------------------------------------------------
create table testdatetime(
ID integer not null primary KEY,
createdate CHAR(10) NULL,
startdate DATE NULL,
enddate DATE NULL,
buydate CHAR(10) NULL,
usedate varchar2(20) NULL ) ;
------------------------ 日期时间范围查询 ------------------------------------
SELECT t.*,t.ROWID FROM testdatetime t ;
–字段为:字符串类型(char),长度为:10
SELECT * FROM testdatetime t WHERE 1=1 AND t.createdate = ‘2011-07-01’;
SELECT * FROM testdatetime t WHERE 1=1 AND t.createdate > ‘2011-07-01’;
SELECT * FROM testdatetime t WHERE 1=1 AND t.createdate < ‘2011-07-01’;
SELECT * FROM testdatetime t WHERE 1=1 AND t.createdate >= ‘2011-06-01’ ANDt.createdate <= ‘2011-07-05’;
sql在日期范围查询
最新推荐文章于 2024-07-31 21:32:36 发布