For fetching the values of REPLACE() function in our choice column name, we need to use the keyword ‘AS’ with REPLACE() function.
Example
mysql> Select Name, REPLACE(Name, 'G','S') AS Name_Changed from student Where Subject = 'Computers'; +--------+--------------+ | Name | Name_Changed | +--------+--------------+ | Gaurav | Saurav | | Gaurav | Saurav | +--------+--------------+ 2 rows in set (0.00 sec)
The query above will give the result set of REPLACE() function in column name of our choice ‘Name_Changed’ which is given after keyword ‘AS’.