문제

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