Order of distinct and top is wrong
muuvmuuv opened this issue · 5 comments
muuvmuuv commented
When using both, distinct will come after "top 20" which results in an SQL error.
muuvmuuv commented
Fix:
$sql = preg_replace('/^SELECT(\s+DISTINCT)?\s/i', 'SELECT$1 TOP ' . $count . ' ', $sql);
In shardj/zf1-future/library/Zend/Db/Adapter/Sqlsrv.php:618
develart-projects commented
Anyone to create PR and test locally?
muuvmuuv commented
Does it have or need tests? We have it in production at one customer and no issues since i vreated the ticket so far
develart-projects commented
If it's already proven, then just create an PR pls.