select count(*) from adv_groups where group_key = :group_key and $pretty_name_sql and trim(rotation_method) = :rotation_method