sql - String Concatenation with comma -
i trying build string comma space. how can remove space between zipcode , country_name? here string. thank suggestion.
select (coalesce(address + ', ', '') + coalesce(city + ', ', '') + coalesce(state_code + ' ', '') + coalesce(zipcode + ' ', '') + coalesce(country_name + '', '')) address table1 a_id = 2 here result:
tewt, test ct, de 4444 united states
you can use rtrim function remove white space right side of variable. check ltrim left cases.
Comments
Post a Comment