select * from table where ddate=to_date('2004-11-11','yyyy-mm-dd')-1
select * from table where ddate=to_date('2004-11-11','yyyy-mm-dd')-1
select * from table where to_char(ddate+1,'yyyy-mm-dd')='2004-11-11'
GerryYang(轻尘)兄,你好象写成后一天的了吧,呵呵
select * from table where ddate=to_date('2004-11-11','yyyy-mm-dd')-1
很简单: select * from table where to_char(ddate,'yyyy-mm-dd')='2004-11-10';
呵呵。select * from table where to_char(ddate-1,'yyyy-mm-dd')='2004-11-11'; select * from table where to_char(ddate,'yyyymmdd')='20041111'-1; select * from table where ddate+1=to_date('2004-11-11','yyyy-mm-dd'); .......问题是楼主的'2004-11-11'是个变值还是定值??
select * from table where date_col between trunc(sysdate-1) and trunc(sysdate);
select * from table where to_char(ddate,'yyyy-mm-dd')='2004-11-10';
呵呵。select * from table where to_char(ddate-1,'yyyy-mm-dd')='2004-11-11';
select * from table where to_char(ddate,'yyyymmdd')='20041111'-1;
select * from table where ddate+1=to_date('2004-11-11','yyyy-mm-dd');
.......问题是楼主的'2004-11-11'是个变值还是定值??