设为首页 加入收藏

TOP

sql查询结果格式化
2014-11-24 07:34:00 来源: 作者: 【 】 浏览:2
Tags:sql 查询 结果 格式
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
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇centos下MySQL 5.5.11 CMake安装.. 下一篇mysql in函数结果不同预期,异常n..

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容:

·Asus Armoury Crate (2025-12-26 02:52:33)
·WindowsFX (LinuxFX) (2025-12-26 02:52:30)
·[ Linux运维学习 ] (2025-12-26 02:52:27)
·HTTPS 详解一:附带 (2025-12-26 02:20:37)
·TCP/IP协议到底在讲 (2025-12-26 02:20:34)