Home > Database > Mysql Tutorial > sql查询结果格式化_MySQL

sql查询结果格式化_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-06-01 13:34:46
Original
1681 people have browsed it

bitsCN.com

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   

 

bitsCN.com
Related labels:
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Issues
MySQL stops process
From 1970-01-01 08:00:00
0
0
0
Error when installing mysql on linux
From 1970-01-01 08:00:00
0
0
0
phpstudy cannot start mysql?
From 1970-01-01 08:00:00
0
0
0
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template