- Trending Categories
- Data Structure
- Operating System
- C Programming
- Selected Reading
- UPSC IAS Exams Notes
- Developer's Best Practices
- Questions and Answers
- Effective Resume Writing
- HR Interview Questions
- Computer Glossary
- Who is Who
How can I fetch the value of REPLACE() function in the column name of our choice?
152 Lectures 16 hours
87 Lectures 5.5 hours
For fetching the values of REPLACE() function in our choice column name, we need to use the keyword ‘AS’ with REPLACE() function.
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’.
- How can we create our own choice MySQL database?
- Fetch a specific column value (name) in MySQL
- How can I change the name of an existing column from a MySQL table?
- How can I insert a value in a column at the place of NULL using MySQL COALESCE() function?
- How can we increase the effectiveness of our communication?
- How can I query for all the tables having a particular column name?
- Fetch the maximum value from a MySQL column?
- How can I find the number of arguments of a Python function?
- How can I change the field name in MongoDB?
- How can I get the output based on comparison done with column’s name using MySQL IN() function?
- Find the column name of least value in each row of an R dataframe.
- Fetch the first letter of a column value and insert it in another column with MySQL
- How can I use IFNULL() function at the place of COALESCE() function in MySQL?
- How can MySQL find and replace the data with REPLACE() function to UPDATE the table?