1 本意打算当scene = 5 直接取5 2 3 错误写法:因为写在下面始终走不了下面那个本意走的case
SELECT
CASE
WHEN scene<8 AND scene <> 4 THEN scene+1
WHEN scene = 5 AND type IN (8,12) THEN 5
ELSE 8
END AS scene
正确写法:
SELECT
CASE
WHEN scene = 5 AND type IN (8,12) THEN 5
WHEN scene<8 AND scene <> 4 THEN scene+1
ELSE 8
END AS scene