Replacing text in a table field
Posted on: April 3rd, 2008 by adminSometimes it is necessary to replace some of your known data with something else. For example if you have the word Downtown you may want to say CBD instead.
In SQL you can do this using the replace directive.
select name=replace(name, ‘Downtown’, ‘CBD’) from places
This doesent change the table but simply changes the dataset meaning you can use SQL to do basic editing before you display it. It speeds up deployment as you dont have to read the field in ASP/PHP and change it. You do all that hard work in SQL.

