Home > Database > Mysql Tutorial > body text

How can we use the output of any expression, function, etc. that MySQL self-evaluates to insert a value in a row?

WBOY
Release: 2023-09-10 22:13:02
forward
1156 people have browsed it

我们如何使用 MySQL 自计算的任何表达式、函数等的输出来在行中插入值?

When inserting a value in a row, we can use any expression, function, etc. to self-calculate the output value. 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)
Copy after login

The above is the detailed content of How can we use the output of any expression, function, etc. that MySQL self-evaluates to insert a value in a row?. 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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!