方法一
select
*
from
AAA
where
to_char(a,
'yyyymmdd'
) = to_char(sysdate,
'yyyymmdd'
);
select
*
from
AAA
where
to_char(a,
'yyyymmdd'
) = to_char(sysdate-1,
'yyyymmdd'
);
方法二
select
*
from
AAA
where
trunc(a) = trunc(sysdate);
select
*
from
AAA
where
trunc(a) = trunc(sysdate)-1;
来源 http://bbs.csdn.net/topics/390972038?page=1