Home > Database > Mysql Tutorial > body text

SQLServer2005 CASE WHEN在项目中实例-查询显示值替换

WBOY
Release: 2016-06-07 17:37:47
Original
1349 people have browsed it

1.利用SqlServer中的case when来把数据查询出来的数据替换成其它值显示 2.结果对比: 普通select查询出来的结果如下: 用了case when方法后显示结果如下: 3.具体使用代码如下: select cInvCode,cValueType, case when cValueType =then when cValueType =t

1.利用SqlServer中的case when来把数据查询出来的数据替换成其它值显示

2.结果对比:

 普通select查询出来的结果如下:

 用了case when方法后显示结果如下:

 

3.具体使用代码如下:

 

select cInvCode,cValueType, case when cValueType=then when cValueType=then end as cValueType ,isnull(iInvRCost,0) from Inventory ,

Related labels:
source:php.cn
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!