0

このSQLをcodeignitersアクティブレコード形式に変換するにはどうすればよいですか

SELECT COUNT(*)
FROM(
SELECT DISTINCT component
FROM `multiple_sample_assay_abc`
WHERE labref = 'NDQA201303001'
)x

この関数を試しましたが、SQL エラーが発生しました

 function getAssayMultipleCount($labref){
        $this->db->count_all('*');
        $this->db->from();
        $this->db->distinct('component');
        $this->db->from('multiple_sample_assay_abc');
        $this->db->where('labref',$labref);
        $query=  $this->db->get();
        return $result=$query->result();
        //print_r($result);
    }
4

2 に答える 2