首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

一个SQL查询的有关问题,大家来看看。

2012-06-14 
一个SQL查询的问题,大家来看看。。SQL codeSELECT [Department],[#],[Created Date],[Planned Date],[Planne

一个SQL查询的问题,大家来看看。。

SQL code
SELECT [Department]      ,[#]      ,[Created Date]      ,[Planned Date]      ,[Planned Time]      ,[Staff Name]      ,[Dealer]      ,[Addr# 1]      ,[Addr# 2]      ,[Model No#]      ,[Problem 1]      ,[Problem 2]      ,[Problem 3]      ,[Problem leading to delay]      ,[Remarks]      ,[Contact]      ,[Tel 1]      ,[Tel 2]      ,[e-mail address]      ,[Type]      ,[Job status]      ,[Job status date]      ,[FSO#]      ,[Amount]      ,[Paid]      ,[Quotation#]      ,[Warranty Card#]      ,[Status]      ,[Status_Deadline]      ,[Step]      ,[Call you in advance]      ,[Arrive on time]      ,[Identity and Uniform]      ,[Satisfied with service]      ,[Politeness]      ,[Solve the issue]      ,[Recommend Johnson Controls]      ,[Any comment]  FROM [JCIHKEroom1].[dbo].[temp]

这里面有两个字段,分别是:[Addr# 1],[Addr# 2],我想在查询的时候,把这两个字段里面的值加到一起输出出来,[Addr# 2]这个字段里面有空值,我用:[Addr# 1]+[Addr# 2],这样是查不出来的,大家看看有什么好办法没?

[解决办法]
ISNULL([Addr# 1],'')+ISNULL([Addr# 2],'')

热点排行