I need to get comma separated values of a column in an sql query as given in example below...consider we have two tables citytable and areatable..where ref col is city_code...
select city.city_code, (SELECT @AreaCodes = COALESCE(@AreaCodes + ';', '') +
area.area_code FROM areatable area where area.city_code = city.city_code)
from citytable city
where city.city_size > '100'
NOTE: - consider city.city_siae in sqkm
i am getting an error like "Incorrect syntax near '='." ....i want above query to return the results like below
CITY AREA CODE