I'm trying to retrieve a count of all unique values in a field.
SELECT count(distinct accessid) FROM (`accesslog`) WHERE record = '123'
How can I do this kind of query inside of CodeIgniter?
I know I can use
$this->db->query(), and write my own SQL query, but I have other requirements that I want to use
$this->db->where() for. If I use
->query() though I have to write the whole query myself.