having and cmp , add some case