发布网友 发布时间:2022-04-23 22:53
共1个回答
热心网友 时间:2022-04-10 21:56
SELECT NODE_TREEVIEW.NODE_NAME,
(CASE
WHEN (TEMPERATURE >= '100') THEN
'1'
ELSE
NULL
END),
(CASE
WHEN (BATTERY >= '100') THEN
'2'
ELSE
NULL
END),
(CASE
WHEN (FENGSU >= '100') THEN
'3'
ELSE
NULL
END),
(CASE
WHEN (SHIDU >= '100') THEN
'4'
ELSE
NULL
END),
(CASE
WHEN (WASI >= '1000') THEN
'5'
ELSE
NULL
END),
(CASE
WHEN (FENCHEN >= '100') THEN
'6'
ELSE
NULL
END)
FROM NODE_LATEST
INNER JOIN NODE_TREEVIEW
ON NODE_LATEST.LL_ADDR = NODE_TREEVIEW.LL_ADDR
从上面的sql中可以明显看出,把不满足条件的数据显示为null