mirror of
https://github.com/ebean-orm/ebean.git
synced 2024-04-21 10:51:47 +00:00
#375 - javax.persistence.PersistenceException: Query threw SQLException:Incorrect syntax near the keyword distinct
This commit is contained in:
@@ -31,10 +31,11 @@ public class MsSqlServer2005SqlLimiter implements SqlLimiter {
|
||||
|
||||
if (firstRow < 1) {
|
||||
// just use top n
|
||||
sb.append(" select top ").append(lastRow).append(" ");
|
||||
sb.append(" select ");
|
||||
if (request.isDistinct()) {
|
||||
sb.append("distinct ");
|
||||
}
|
||||
sb.append(" top ").append(lastRow).append(" ");
|
||||
sb.append(request.getDbSql());
|
||||
return new SqlLimitResponse(sb.toString(), false);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user