Hi Guys I have two tables table B has a many to 1 relationship with table A
TableA TableB
id name id value
1 basketA 1 10
2 basketB 1 5
1 7
2 7
2 3
etc..
now
$query = $this->db->get(‘TableA’);
return $query->result_array();
returns the A fields obviously but how can I do a join so it will return A-Field along with the sum of the B-Items for that field?
eg. in the result array
BasketA 22
BasketB 10
Thanks in advance!
try this: