如何獲取table_1不在表2中的ID
我的表看起來像這種類型。
TABLE_1
如何獲取不在表2中的值
---------------------------------------------
| id | user |
---------------------------------------------
| 1 | Jack |
---------------------------------------------
| 2 | John |
---------------------------------------------
TABLE_2
------------------------------------------
| web_id | website |
------------------------------------------
| 2 | Facebook |
------------------------------------------
| 3 | Google+ |
------------------------------------------
我想笨查詢
$this->db->select("*");
$this->db->from("table_1");
$this->db->where_not_in('id', "table_2.web_id");
return $this->db->get();
如何在這些2個表有關? – DevelopmentIsMyPassion
我認爲ID和web_id – zzlalani
我已經添加了兩種方式下面的查詢 –