How to use an SQL function in the ON expression of a JOIN clause with CodeIgniter's query builder
01:30 29 Sep 2016

How to build a query's JOIN clause when the data type between the related columns is different? When I use CAST() in the ON expression there is an error.

$this->db->join(
    't_mtr_activity_employee',
    't_trx_activity.nik = CAST('t_mtr_employee.nik'),
    'inner'
); 
php postgresql codeigniter join query-builder