如何使用一个 SQL 查询连接 2 个具有不同列名的表?
假设我有这张桌子:
+----+--------+----------+
| id | name | car |
+----+--------+----------+
| 1 | Name 1 | Audi |
| 2 | Name 2 | BMW |
| 3 | Name 3 | Mercedes |
+----+--------+----------+
还有这张表
+----+--------+----------+
| id | name | bike |
+----+--------+----------+
| 1 | Name 4 | Kawasaki |
| 2 | Name 5 | Triumph |
| 3 | Name 6 | Ducati |
+----+--------+----------+
我想把它变成这样
+--------+----------+
| name | Brand |
+--------+----------+
| Name 1 | Audi |
| Name 2 | BMW |
| Name 3 | Mercedes |
| Name 4 | Kawasaki |
| Name 5 | Triumph |
| Name 6 | Ducati |
+--------+----------+