SELECT count(DISTINCT case is_not_exit when true then enterprise_id end) from table_a
实例
select count(DISTINCT case when cd.LikeShareUserId = '101172' and cd.IsLike = 1 then cd.LikeShareUserId end) AS DeleteArticleNum from E_CMS_Community_Details AS cd