case when
SELECT
(case when cdi.DEVICE_TAG is not null then cdi.DEVICE_TAG else '暂无数据' end) as deviceTag,
(case when cdi.DEVICE_CODE is not null then cdi.DEVICE_CODE else '暂无数据' end) as deviceCode,
(case when sc.full_name is not null then sc.full_name else '暂无数据' end) as deviceVendor,
(case when ct.CLASS_NAME is not null then ct.CLASS_NAME else '暂无数据' end) as deviceTypeNameB,
(case when cdi.DEVICE_PORT is not null then cdi.DEVICE_PORT else '暂无数据' end) as devicePort,
(case when cdi.CREATE_TIME is not null then cdi.CREATE_TIME else '暂无数据' end) as createTimeStr
-- cdi.DEVICE_TAG as deviceTag,
-- cdi.DEVICE_CODE as deviceCode,
-- sc.full_name as deviceVendor,
-- ct.CLASS_NAME as deviceTypeNameB,
-- cdi.DEVICE_PORT as devicePort,
-- cdi.CREATE_TIME as createTimeStr
FROM
con_device_info AS cdi
left join sys_code AS sc ON sc.code_value = cdi.DEVICE_VENDOR
LEFT join con_type as ct on ct.ID=cdi.DEVICE_TYPE
where cdi.ID=#{id}
重点:
case when xxx
is null 或者is not null
完整原文: http://blog.maptoface.com/post/173
文章最后发布于: 2019-05-28 10:04:55
相关阅读
下面给你它们四则运算的规律:1奇函数+奇函数=奇函数2奇函数+偶函数=非奇非偶函数(特殊的可能是别的结果,不过特殊时可以用定义判断
小编最近的生活朋友圈当中几乎被微博微信投票活动的话题给占据甚至好多朋友花钱去刷票,小编相当的反感这些虚拟的一些比赛,但是又好
/// /// 判断两个向量是否平行 /// Lhs. /// Rhs. /// true:平行 false:不平行 /// public static bool IsParallel(Vector3
Map可以出现在k与v的映射中,v为null的情况Map集合允许值对象为null,并且没有个数限制,所以当get()方法的返回值为null时,可能有两种情
摄氏度和华氏度转换?自己写的几种垃圾程序,里面有swithc
先是第一种,需要用户自己先选择时摄氏度还是华氏度,不好用 #include <iostream> using namespace std; int main() { char FC;