mysql中燕十八:一道面试题使用union all实现两张表id相同的num值相加。 | 您所在的位置:网站首页 › 两张表相加 › mysql中燕十八:一道面试题使用union all实现两张表id相同的num值相加。 |
(1)先创建两张表,分别为a,b create table a ( id char(1), num int )engine myisam charset utf8; insert into a values (‘a’,5),(‘b’,10),(‘c’,15),(‘d’,10); create table b ( id char(1), num int )engine myisam charset utf8; insert into b values (‘b’,5),(‘c’,15),(‘d’,20),(‘e’,99); |
CopyRight 2018-2019 实验室设备网 版权所有 |