2
SELECT field1, field2
FROM table1
JOIN table2 ON (table2.field1=table1.field1 OR table2.field2=table1.field2)
如何在CodeIgniter中编写此查询?我想在JOIN条件中有括号。CodeIgniter:如何在JOIN条件中使用括号
笨样品
$this->db->select("field1,field2")
$this->db->from("table1")
$this->db->join("table2","(table2.field1=table1.field1 or table2.field2=table1.field2)")
但这会产生错误。
请发布错误消息。 – 2012-08-11 15:30:32