Welcome Guest, Not a member yet? Register   Sign In
Possible bug on count_all_results with distinct clause???
#1

[eluser]Nextneed[/eluser]
hi to all,
i've notice that the following statement

$this->db->distinct("azioni_finanziabili_id");
$this->db->from("azioni_schede_beneficiari_schede");
$this->db->where_in("beneficiari_schede_id", $beneficiari_check);
$azioni_count = $this->db->count_all_results();

produce the following query:
SELECT COUNT(*) AS numrows
FROM (azioni_schede_beneficiari_schede)
WHERE beneficiari_schede_id IN ('65', '67')

and ignore the distinct statement...

if i run the same query instead of counting results i obtain the following...
SELECT DISTINCT *
FROM (azioni_schede_beneficiari_schede)
WHERE beneficiari_schede_id IN ('67', '65')

which is correct...

bye
Luca


Messages In This Thread
Possible bug on count_all_results with distinct clause??? - by El Forum - 05-07-2010, 09:32 AM



Theme © iAndrew 2016 - Forum software by © MyBB