select count(*) from basecard where productdate < '1970' ;select sum(decode (sign(to_date(product_date) - to_date('1970-1-1')),-1,1,0) )from basecard;
出厂日期1970年前的统计 select count(*) from basecard where productdate<'1970' 如果productdate为DATE型。可用 select count(*) from basecard where productdate<to_date('1970-1-1','yyyy-mm-dd')
select count(*) from basecard where productdate<'1970'
如果productdate为DATE型。可用
select count(*) from basecard where productdate<to_date('1970-1-1','yyyy-mm-dd')
如果条件更复杂些,可以用case when,呵呵