select case when count(*) = 0 then 0 else 1 end from ab_contacts where contact_id = :contact_id