postgresql7.1 select count(*) from dual where exists (select 1 from dotlrn_terms where dotlrn_terms.end_date > now())