- 按条件返回某些字段值。例如枚举值。
select
c.id,
c.apiName,
CASE c.method
WHEN 1 THEN 'GET'
WHEN 0 THEN'POST'
END 'method',
from api_generator_api_conf c;
image.png
select
c.id,
c.apiName,
CASE c.method
WHEN 1 THEN 'GET'
WHEN 0 THEN'POST'
END 'method',
from api_generator_api_conf c;
image.png
本文标题:MYSQL case when
本文链接:https://www.haomeiwen.com/subject/vtjkmktx.html
网友评论