1、建立測試表,
create table test_sysdate(v_date date);
2、插入測試資料
insert into test_sysdate values(sysdate);
insert into test_sysdate values(sysdate-1);
insert into test_sysdate values(sysdate-1.1);
insert into test_sysdate values(sysdate-1.2);
insert into test_sysdate values(sysdate-2);
insert into test_sysdate values(sysdate-3);
3、查詢表中所有記錄數,select t.*, rowid from test_sysdate t,
4、編寫sql,查詢日期為前一天的記錄,select t.*, rowid from test_sysdate t where to_char(v_date,"yyyymmdd") = to_char(sysdate-1,"yyyymmdd")
1、建立測試表,
create table test_sysdate(v_date date);
2、插入測試資料
insert into test_sysdate values(sysdate);
insert into test_sysdate values(sysdate-1);
insert into test_sysdate values(sysdate-1.1);
insert into test_sysdate values(sysdate-1.2);
insert into test_sysdate values(sysdate-2);
insert into test_sysdate values(sysdate-3);
3、查詢表中所有記錄數,select t.*, rowid from test_sysdate t,
4、編寫sql,查詢日期為前一天的記錄,select t.*, rowid from test_sysdate t where to_char(v_date,"yyyymmdd") = to_char(sysdate-1,"yyyymmdd")