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

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

WBOY
WBOYOriginal
2016-06-07 17:37:471350browse

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 ,

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