Welcome Guest, Not a member yet? Register   Sign In
combining two rows wit the Query Builder
#2

You can't do a GROUP BY on an INSERT statement.

You'd need to merge the arrays before you insert them (or SELECT them, then merge the arrays then remove the rows and reinsert the merged array).

Probably something like this.

PHP Code:
// ... after selecting $row1 and $row2
$data array_merge(array_filter($row1), array_filter($row2));
$this->db->delete('substantially_all_render_temp', [
    'BC' => $row1['BC'],
    'taxyear' => $row1['taxyear']
]);
$this->db->insert('substantially_all_render_temp'$data); 
Reply


Messages In This Thread
RE: combining two rows wit the Query Builder - by ojmichael - 07-07-2021, 12:00 AM



Theme © iAndrew 2016 - Forum software by © MyBB