在此:選擇where子句是間隔
$this->db->select('count(o.id)');
$this->db->from('orders o');
$this->db->join('order_status_history', 'o.id = order_status_history.order_id');
$this->db->where("(order_status_history.in_dts)::date ='" .$reportDay. "'");
$this->db->where('order_status_history.new_status ' , 6);
我想選擇計數(ID),其中order_status_history.new_status是一個間隔例如(2 < = order_status_history.new_status < = 6),沒有一個單一INT。如何在這個SQL中做到這一點?
工作的感謝大家! – 2013-03-05 09:24:25