开发者

concatenate two columns with equal space

edit

SELECT  (dbo.County.CountyName + ' (' + dbo.State.StateName + ' ) ') 
AS CountyName from Table1

i am adding two columns for an example:

CountyName + '(' + StateName + ')'

how can i make sure or have fixed width of CountyName so that it looks neat/clean

for an example:

Torrance     (California)
Torrance     (Chicago)
Cook         (Chicag开发者_运维技巧o)
....


select CountyName + space(20-len(CountyName)) + '(' + StateName + ')'...
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜