|
如何 Join 3 tables 并显示 Table 1 message 中包含
member_id = 50 or member_id_2 = 50
所对应的 member 55,56 在
Table 1 message - member_title or member_title_2
Table 2 skill - member_skill
Table 3 profile - age
但不显示 member_id = 50 or member_id_2 = 50
----------显示结果
member_id, member_title, member_skill,age
55 Account skill_55_1 25
56 Staff1 skill_56_2 26
55 Account skill_55_1 25
---------- Table 1 message
ID, member_id, member_title, member_id_2,member_title_2, member_id_skill, member_id_2_skill
1 50 manager 55 Account 1 3
2 50 manager 56 Staff1 2 5
3 55 Account 50 manager 3 2
...
---------- Table 2 skill
ID, member_id, member_skill
1 50 skill_50_1
2 50 skill_50_2
3 55 skill_55_1
4 56 skill_56_1
5 56 skill_56_2
---------- Table 3 profile
ID, member_id, age
1 50 24
2 55 25
3 56 26
----------- 如何$this->db->join();
多谢!
|
|