SelectName,REPLACE(Name,'G','S')ASName_ChangedfromstudentWhereSubject='Computers';+--------+----------- ---+|Name|Name_Changed|+--------+--------------+|Gaurav|Saurav||Gau"/> SelectName,REPLACE(Name,'G','S')ASName_ChangedfromstudentWhereSubject='Computers';+--------+----------- ---+|Name|Name_Changed|+--------+--------------+|Gaurav|Saurav||Gau">
In order to get the value of the REPLACE() function in the column name we selected, we need to use the keyword "AS" in the REPLACE() function.
The Chinese translation ofmysql> 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 above query will give the result set of the REPLACE() function in our selected column name "Name_Changed" which is given after the keyword "AS".
The above is the detailed content of How to get the value of REPLACE() function in the column name we selected?. For more information, please follow other related articles on the PHP Chinese website!