如何使用 MySQL 自计算的任何表达式、函数等的输出来在一行中插入值?
mysqlmysqli database更新于 2025/4/6 8:44:17
在行中插入值时,我们可以使用自计算的任何表达式、函数等的输出值。下面是一个例子来演示它 −
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)
相关文章
有用资源
mysql 参考教程 - 该教程包含有关 mysql 的更多信息:https://www.cainiaomax.com/mysql/

