Home  >  Article  >  Database  >  Case 条件运算符

Case 条件运算符

WBOY
WBOYOriginal
2016-06-07 17:43:031306browse

Case运算有两种写法,平常用的都比较多,这里只简单复习下,Case的语法帮助里就好,这里我尝试用颜色区分的方式让大家一眼就能了解其结构: 写法一:) select serviceItemCode = '018' then '1-018' when serviceItemCode = '019' then '1-019' end service

Case运算有两种写法,香港服务器租用,香港服务器,平常用的都比较多,这里只简单复习下,Case的语法帮助里就好,这里我尝试用颜色区分的方式让大家一眼就能了解其结构:

写法一:) select serviceItemCode = '018' then '1-018' when serviceItemCode = '019' then '1-019' end serviceItemCode = '001' then '0-001' end else '其它' end as 'case计算',serviceItemCode,ServiceItemName,PriceType from CSM_Bas_ServiceItem order by 'case计算' desc ,虚拟主机

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