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

sql查询结果格式化_MySQL

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-01 13:34:461684browse

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
Statement:
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