0
点赞
收藏
分享

微信扫一扫

case when 中计数如何去重

Python百事通 2022-02-09 阅读 63
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

举报

相关推荐

0 条评论