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.
是否可以将查询结果转换为字符串,例如:
SELECT ID, Name, State
结果是:
1 乔 1 2史蒂夫2 3 伊恩 1
我想将状态结果转换如下:
1 琼斯没有 2史蒂夫是的 3 伊恩·诺
select id, name, case when state = 1 then 'NO' else 'YES' end as state_text from the_table
您可以尝试:
SELECT ID, Name, IF(State = 1, 'NO', 'YES')