[Solved] How to join 2 table and return value


You can use this query

 SELECT t1.* FROM first_tbl AS t1
 LEFT JOIN second_tbl AS t2 ON t1.order_number = t2.order_number
 WHERE t2.ID IS NULl

And it will return only the 333333 record

See this DB fiddle for example

This is how it would look in CI:

$this->db->select("t1.*")
$this->db->from("first_tbl AS t1");
$this->db->join("second_tbl AS t2 ", "t1.order_number = t2.order_number", "left");
$this->db->where("t2.id IS NULL");

var_dum($this->db->get()->result());

0

solved How to join 2 table and return value