您好,我正在考虑以下事项:
CASE
WHEN xyz.something = 1 THEN 'SOMETEXT'
WHEN xyz.somethingelse = 1 THEN 'SOMEOTHERTEXT'
WHEN xyz.somethingelseagain = 2 THEN 'SOMEOTHERTEXTGOESHERE'
ELSE 'SOMETHING UNKNOWN'
这是否有效地ELSE
介于两者之间WHEN
,即xyz.something = 1
优先于xyz.somethingelse = 1
?
如果不是,这是正确的方法吗?
CASE WHEN xyz.something = 1 THEN 'SOMETEXT' ELSE
CASE WHEN xyz.somethingelse = 1 THEN 'SOMEOTHERTEXT' ELSE
CASE WHEN xyz.somethingelseagain = 2 THEN 'SOMEOTHERTEXTGOESHERE'
ELSE 'SOMETHING UNKNOWN'