根据客户要求显示记录 [英] Displaying records according to client recquirement
本文介绍了根据客户要求显示记录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个表,其中包含诸如
的列
房屋编号 街道 面积 城市
#23 C Block Malleshwaram班加罗尔
#34 M.palya Electronic City德里
现在我要显示例如
地址
#23,C块
Malleshwaram
班加罗尔
#34,M.palya
电子城
德里
请以哪种方式帮助我?
I have a table that contain column such as
HouseNo Street Area City
#23 C Block Malleshwaram Bangalore
#34 M.palya Electronic City Delhi
Now I want to display such as
Address
#23, C Block
Malleshwaram
Bangalore
#34,M.palya
Electronic City
Delhi
Please help me in which way i can do this?
推荐答案
在存储过程或SQL查询中写入以下内容.尝试看看是否有帮助:
Write the following in your stored procedure or SQL query. Try and see if it helps:
LTRIM(RTRIM(c.HouseNo)) + ', ' + LTRIM(RTRIM(c.Street))
+ ' ' + LTRIM(RTRIM(c.Area)) + ' ' + LTRIM(RTRIM(c.City))
as Address
尝试按如下所示编写查询
Try writing your query as shown below
SELECT HouseNo + ', ' + Street
+ CHAR(13) + CHAR(10) --new line feed char
+ Area
+ CHAR(13) + CHAR(10)
+ City AS [Address] FROM [YourTableName]
您可以使用where子句仅检索所需的地址.
You can use where clause to only retrieve the required address.
这篇关于根据客户要求显示记录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文