質問

I am trying to return information from a table (called addresses) with several columns. The physical address is divided into line1, line2, city, state, etc. I want to display all columns in the table, but want to combine the line1 and line2 columns into a single column named street.

Is there a way to do this without listing every single column on the table?

役に立ちましたか?

解決

Try like this

SELECT Line1 + ',' + Line2, city, state From Address

(Or)

SELECT concat(line1, ' , ', line2) , city, state From Address

他のヒント

SELECT line1 + line2 AS street, city, state FROM addresses

Try this..

SELECT Line1 + ',' + Line2 as Street, city, state From [TableName]
ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top