我有一个如下所示的 Mysql 表(CONFIGS):
+---------+
| config |
+---------+
| ie8 |
| Firefox |
| Chrome |
+---------+
我有另一个表(PROJECTS),看起来像:
+---------+----------------+--------------+
| config | name | passed_count |
+---------+----------------+--------------+
| Firefox | Project 1 | 0 |
| Chrome | Project 1 | 3 |
| Chrome | Project 2 | 1 |
| Firefox | Project 2 | 0 |
| ie8 | Project 2 | 0 |
+---------+----------------+--------------+
我希望最终结果看起来像:
+---------+----------------+--------------+
| config | name | passed_count |
+---------+----------------+--------------+
| Firefox | Project 1 | 0 |
| Chrome | Project 1 | 3 |
| ie8 | Project 1 | 0 |
| Chrome | Project 2 | 1 |
| Firefox | Project 2 | 0 |
| ie8 | Project 2 | 0 |
+---------+----------------+--------------+
基本上我希望所有项目都与所有配置相关联
| ie8 | Project 1 | 0 |
这是我要添加的另一个字段
我尝试了各种 LEFT JOINS,RIGHT JOINS,但无法使其正常工作。任何人都可以帮助我吗?