而不是NULL id而不是空白 [英] Rather than NULL id rather them be blank

查看:122
本文介绍了而不是NULL id而不是空白的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

SELECT [Rank]

,[优先级]

,[%完成]

,[项目名称]

,[项目经理]

,[已分配给]

,[类别]

,[受影响的组别]

,[状态]

,[请求截止日期]

,[请求者]

,[项目冠军]

,[创建]

,[AVP团队]

来自[COE_PROJECTS]。[19]。[COE_PROJ_01_19_2017]

预定1



我尝试过:



我真的不知道该尝试什么。我对SQL很新。

SELECT [Rank]
,[Priority]
,[% Complete]
,[Project Name]
,[Project Manager]
,[Assigned To]
,[Category]
,[Impacted Group(s)]
,[Status]
,[Requested Due Date]
,[Requested By]
,[Project Champion]
,[Created]
,[AVP Team]
FROM [COE_PROJECTS].[19].[COE_PROJ_01_19_2017]
order by 1

What I have tried:

I dont really know what to try. I am quite new to SQL.

推荐答案

您好:

我不确定您问题的含义。但如果问题是如何将查询的输出从 null 更改为 blank ,则可以使用 coalesce 功能。

假设项目名称是一个字符串,%完成是数字,查询将是:



Hello:
I'm not sure of the meaning of your question. But if the question is how to change the output of your query from null to "blank", you can use coalesce function.
Assuming that "project name" is a string and "% complete" is numeric the query will be:

<br />
select [Rank]<br />
,[Priority]<br />
,COALESCE([% Complete],0) AS [% Complete]<br />
,COALESCE([Project Name],'') AS [Project Name]<br />
,[Project Manager]<br />
,[Assigned To]<br />
,[Category]<br />
,[Impacted Group(s)]<br />
,[Status]<br />
,[Requested Due Date]<br />
,[Requested By]<br />
,[Project Champion]<br />
,[Created]<br />
,[AVP Team]<br />
FROM [COE_PROJECTS].[19].[COE_PROJ_01_19_2017]<br />
order by 1<br />

这篇关于而不是NULL id而不是空白的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆