I have a varchar
column which has a variation of the following string:
Stations, FlightName, FlightWeeks, BindTo, SpotLength, foo, bar, etc...
I need to change it to Stations
to Station
, FlightName
to Flight Name
, BindTo
to Bind To
etc to eventually come out like this:
Station; Flight Name; Weeks; Bind To; Spot Length; foo; bar
etc
I have a really ugly code to do this:
select replace(replace(replace(replace(replace(replace(GroupFlightsBy, ', ', ';'),
'Stations', 'Station'), 'FlightName', 'Flight Name'), 'FlightWeeks', 'Weeks'), 'BindTo', 'Bind To'),
'SpotLength', 'Spot Length')
Is there a better way of doing this, yet as performant?