Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

count_all_results() ignores DISTINCT or list of fields #2572

Closed
Huji opened this issue Jul 31, 2013 · 1 comment
Closed

count_all_results() ignores DISTINCT or list of fields #2572

Huji opened this issue Jul 31, 2013 · 1 comment

Comments

@Huji
Copy link

Huji commented Jul 31, 2013

In the following example:

$this->db->select('name, age');
$this->db->distinct();
$this->db->from('people');
echo $this->db->count_all_results();

The query generate looks like:

SELECT COUNT(*) FROM ...

It is expected to look like:

SELECT COUNT(DISTINCT `name`, `age`) FROM ...

The returned number is therefore incorrect.

@narfbg
Copy link
Contributor

narfbg commented Jul 31, 2013

#59

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants