首页 > 数据库技术 > 详细

sql case when then 语法使用

时间:2020-11-11 17:59:54      阅读:28      评论:0      收藏:0      [点我收藏+]
select distinct
        isa.site_id as siteId,
        sb.site_name as siteName,
        isf.id as id,
        isad.type_id as typeId,
        ist.type_name as typeName,
        isf.create_user_id as commitUserId,
        isad.content_item_id as contentItemId,
        u.user_phone as commitTelephone,
        case
        when isad.content_item_id IS NOT NULL THEN isci.item_name
        when isad.content_item_id IS NULL THEN isad.other_item_name
        end as contentItemName
        from table

  

sql case when then 语法使用

原文:https://www.cnblogs.com/onlyzhangmeng/p/13959463.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!