Home > Database > Mysql Tutorial > How to get the value of REPLACE() function in the column name we selected?

How to get the value of REPLACE() function in the column name we selected?

PHPz
Release: 2023-09-10 11:49:02
forward
887 people have browsed it

如何在我们选择的列名中获取 REPLACE() 函数的值?

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 of

Example

is:

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)
Copy after login

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!

source:tutorialspoint.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template