mysql select insert data of contains no column specific implementation
- 2020-05-30 21:11:23
- OfStack
mysql
>
select name, id from table_b; //'name' is not in the table_b table
+------+-----------+
| name | id |
+------+-----------+
| name | 123456 |
| name | 1234567 |
| name | 12345678 |
| name | 123456789 |
+------+-----------+
4 rows in set (0.00 sec)
+------+-----------+
| name | id |
+------+-----------+
| name | 123456 |
| name | 1234567 |
| name | 12345678 |
| name | 123456789 |
+------+-----------+
4 rows in set (0.00 sec)
mysql> insert into table_a(name,b_refer) select 'name', id from table_b; //'name' Not in table_b In the table
Query OK, 4 rows affected (0.03 sec)