mysql> select * from goods;
+----+------------+
| id | name |
+----+------------+
| 1 | apple |
| 2 | apple1 |
| 3 | pear |
| 6 | watermelon |
+----+------------+
4 rows in set (0.00 sec)
mysql> select * from goods_2;
+-----+-------+
| gid | price |
+-----+-------+
| 2 | 10.1 |
| 3 | 20.1 |
| 10 | 12.1 |
+-----+-------+
3 rows in set (0.00 sec)
** mysql> select goods.id, goods.name, goods_2.price from goods full join goods_2 on goods.id=goods_2.gid; **
ERROR 1054 (42S22): Unknown column 'goods.id' in 'field list'
为什么一直报这个错?full outer join也不行,哪里不对呢?感谢回答的老哥。
有疑问加站长微信联系(非本文作者)