-1
我想知道日期間隔內和日期間隔之間的分開工作。但它在一個查詢中不起作用。select where id not in(另一個表的where條件(從兩個日期間隔中獲取的數據))
$this->db->select('*');
$this->db->from('admission');
$this->db->where("'ad_no' not in (SELECT 'ad_no' FROM 'payment' WHERE(
'date' BETWEEN DATE_SUB(date(), INTERVAL $acc DAY) AND date()'))");
$query=$this->db->get()->result_array();
return $query;
謝謝!