Lorenzo B
Lorenzo B

Reputation: 27

how to combine database fields into 1

I'm want to combine address fields into 1.

address)100 noway ln

city) eastjablip

state) No

combined into: address) 100 noway ln, eastjablip, no

While leaving city and state intact. (needed for search option)

Thanks

Upvotes: 0

Views: 54

Answers (1)

Joni
Joni

Reputation: 111349

Use concat_ws ("concatenate with separator")

SELECT CONCAT_WS(', ', address, city, state) ....

Upvotes: 3

Related Questions