Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
当 column1 是这种情况时,我想从 column2 得到结果。当我尝试下面的代码时,我收到错误“%s:无效标识符”。这是我从代码中删除的一个非常简单的示例,但需要以这种方式实现。
CASE columnname WHEN 'Column1' THEN Column2 END AS "MY RESULT"
试试这个
SELECT case WHEN columnname = 'Column1' THEN Column2 END as "MY RESULT"