Data Structure
Networking
RDBMS
Operating System
Java
MS Excel
iOS
HTML
CSS
Android
Python
C Programming
C++
C#
MongoDB
MySQL
Javascript
PHP
- 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 we use MySQL self-computed output from any expression, function etc. for inserting values in a row?
While inserting the values in a row, we can use the value of self-computed output from any expression, function etc. Here is an example to demonstrate it −
mysql> Insert into employee(id, emp_name)Select 1+1, Concat_ws(' ','Gaurav', 'Kumar');
Query OK, 1 row affected (0.04 sec)
Records: 1 Duplicates: 0 Warnings: 0
mysql> Select * from employee;
+------+--------------+
| id | emp_name |
+------+--------------+
| 2 | Gaurav Kumar |
+------+--------------+
1 row in set (0.00 sec)Advertisements