Have someone meet this?
RedBeanPHP give different result set from native PDO result set when using SQL this, (to get top 5)
SELECT CASE WHEN @cn =
a.cn THEN @rank := @rank + 1 ELSE @rank := 1 END AS v1,
CASE WHEN @rank <= 4 THEN cust_name ELSE "other" END AS v3,
SUM(ct) AS v4
FROM xxx a
CROSS JOIN (SELECT @cn := NULL, @rank := 0 ) b
GROUP BY v2, v3
ORDER BY v2, v1 ',
RedBean result by getAll has rows whose rank(v1) > 5, but native PDO returns rows with only rand <=5