You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
when i run this query every thing is ok :
$stmt = $db->table('call_history')
->select('id')
->where('caller_id', $operator_id)
->groupBy('user_id')
->get();
// result is 5 record
but
run this query :
$stmt = $db->table('call_history')
->select('id')
->where('caller_id', $operator_id)
->groupBy('user_id')
->count();
// result is number 30 (common record not grouped)
groupby not true work !
when i remove groupBy from my query every thing is ok
The text was updated successfully, but these errors were encountered:
@mromid Its hard to read what you are trying to say.
What do you expect? The 5 or the 30 records?
Have you tried to see the extracted sql? In this case what is your raw query output...
I think I got what he means,
Steps to reproduce:
Import this really simple table
OR
make one like: purchase_id,purchase_code
1,abc
2,def
Then use QB::table('TABLENAME')->groupBy('purchase_code')->count(); //This will return 1
while if you use a standard query SELECT * FROM TABLENAME GROUP BY purchase_code //It should return 2
when i run this query every thing is ok :
$stmt = $db->table('call_history')
->select('id')
->where('caller_id', $operator_id)
->groupBy('user_id')
->get();
// result is 5 record
but
run this query :
$stmt = $db->table('call_history')
->select('id')
->where('caller_id', $operator_id)
->groupBy('user_id')
->count();
// result is number 30 (common record not grouped)
groupby not true work !
when i remove groupBy from my query every thing is ok
The text was updated successfully, but these errors were encountered: