mirror of
https://github.com/silverstripe/silverstripe-mssql
synced 2024-10-22 06:05:53 +00:00
MINOR FIX: 'DISTINCT' keyword must come before 'TOP'
This commit is contained in:
parent
0ec54f3359
commit
c3a0542c66
@ -1028,7 +1028,7 @@ class MSSQLDatabase extends Database {
|
||||
// If there's a limit but no offset, just use 'TOP X'
|
||||
// rather than the more complex sub-select method
|
||||
if ($limit != 0 && $offset == 0) {
|
||||
$text = "SELECT TOP $limit $distinct";
|
||||
$text = "SELECT $distinct TOP $limit";
|
||||
|
||||
// If there's a limit and an offset, then we need to do a subselect
|
||||
} else if($limit && $offset) {
|
||||
@ -1226,7 +1226,7 @@ class MSSQLQuery extends Query {
|
||||
}
|
||||
|
||||
/*
|
||||
* If we're running the sqlsrv set of functions, then the dataobject set is a forward-only curser
|
||||
* If we're running the sqlsrv set of functions, then the dataobject set is a forward-only cursor
|
||||
* Therefore, we do not have access to the number of rows that this result contains
|
||||
* This is (usually) called from Database::rewind(), which in turn seems to be called when a foreach...
|
||||
* is started on a recordset
|
||||
|
Loading…
x
Reference in New Issue
Block a user