postgresql7.1 select cea.valid_p, ad.domain, cea.alert_id, cea.expires, cea.frequency, cea.alert_type, cea.category, cea.keywords from classified_email_alerts cea, ad_domains ad where user_id = :user_id and ad.domain_id = cea.domain_id and now() <= expires order by expires desc