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

2023年12月24日10:55:59

在将值插入一行时我们可以使用任何表达式,函数等的自计算输出值。下面是一个示例来演示它-

mysql> Insert into employee(id, emp_name)Select 1+1, Concat_ws(' ','Gaurav', 'Kumar');
Records: 1 Duplicates: 0 Warnings: 0

mysql> Select * from employee;
+------+--------------+
| id   | emp_name     |
+------+--------------+
| 2    | Gaurav Kumar |
+------+--------------+
1 row in set (0.00 sec)

  • 更新时间:2023年12月24日10:55:59 ,共 333 字。