我想计算我在mysql上尝试查询和查询工作的时间差
SELECT *, CONCAT_WS(" ", date1, hour1) AS rhour1, CONCAT_WS(" ", date2, hour2) AS rhour2, (SELECT TIMEDIFF(rhour2,rhour1) AS diffhour) from TABLE1
我使用 codeigniter 查询生成器写入活动记录:
$this->db->select('*, CONCAT_WS(" ", date1, hour1) AS rhour1, CONCAT_WS(" ", date2, hour2) AS rhour2, (SELECT TIMEDIFF(rhour2,rhour1) AS diffhour)');
$this->db->from('table1');
$this->db->join('table2','table1.code_number = table2.code_number');
$query = $this->db->get();
结果我无法获得价值 diffhour :(
我的代码活动记录有什么问题?