sql查询结果格式化

2014-11-24 07:34:00 · 作者: · 浏览: 4
sql查询结果格式化
有时候 我们需要对查询结果进行比较
如果值是 A ,则 返回A
如果值是B,则返回BB
以下sql在mysql中测试通过
Java代码
select
id,
monitor_rule_name,
monitor_rule_condition,
CASE
when monitor_rule_condition='lt' then '<'
when monitor_rule_condition='gt' then '>'
when monitor_rule_condition='eq' then '>'
end
as newColumn
from monitor_config_rule_monitor