我有一个查询结果为2个具有相同员工的数据
$this->load->library('datatables');
$this->datatables->select('a.employee_id, a.name, b.employee_position');
->from('employee a')
->join('employee_position b','b.employee_id = .a.employee_id AND `b`.`deleted`=0 AND `c`.`date_start` <= "'.$now_date.'"','inner')
$data = $this->datatables->get_adata();
$aaData = $data->aaData;我不想只出现一个数据,那就是选择date_start列的最大数据,该怎么做?
发布于 2017-07-23 21:30:24
在您的代码中添加以下两行:
$this->db->order_by('c.date_start', 'DESC');
$this->db->limit(1, 1);https://stackoverflow.com/questions/45263398
复制相似问题