Skip to content

Commit 05fcbd4

Browse files
authored
Merge pull request #235 from microsoft/limit-offset-sql-fix
Fix limit_offset_sql to handle cases when there is no OFFSET
2 parents 6a29037 + 3bcc66e commit 05fcbd4

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mssql/operations.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -404,7 +404,7 @@ def limit_offset_sql(self, low_mark, high_mark):
404404
"""Return LIMIT/OFFSET SQL clause."""
405405
limit, offset = self._get_limit_offset_params(low_mark, high_mark)
406406
return '%s%s' % (
407-
(' OFFSET %d ROWS' % offset) if offset else '',
407+
(' OFFSET %d ROWS' % offset) if offset else ' OFFSET 0 ROWS',
408408
(' FETCH FIRST %d ROWS ONLY' % limit) if limit else '',
409409
)
410410

0 commit comments

Comments
 (0)