0
SELECT 
    case_id,
    serialnumber,
    DateLastHere,
    Bookedindate,
    DATEDIFF(DateLastHere,Bookedindate) 
FROM `cases` 
WHERE serialnumber like 'TTTT46'
4

1 回答 1

3

你可以这样做

$data   =   array(
            'case_id',
            'serialnumber',
            'DateLastHere',
            'Bookedindate',
            'DATEDIFF(DateLastHere,Bookedindate)'
            );
$this->db->select($data);
$this->db->from('cases');
$this->db->like('serialnumber','TTTT46');
$query = $this->db->get()->result_array();
于 2013-01-16T06:19:08.560 回答