Skip to content

Commit

Permalink
fixed MSSQL TOP
Browse files Browse the repository at this point in the history
  • Loading branch information
mdipierro committed Aug 4, 2017
1 parent f66ad17 commit c707d55
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pydal/dialects/mssql.py
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ def delete(self, table, where=None):

def select(self, fields, tables, where=None, groupby=None, having=None,
orderby=None, limitby=None, distinct=False, for_update=False):
dst, whr, grp, order, limit, offset, upd = '', '', '', '', '', '', ''
dst, whr, grp, order, limit, upd = '', '', '', '', '', ''
if distinct is True:
dst = ' DISTINCT'
elif distinct:
Expand All @@ -125,8 +125,8 @@ def select(self, fields, tables, where=None, groupby=None, having=None,
limit = ' TOP %i' % lmax
if for_update:
upd = ' FOR UPDATE'
return 'SELECT%s %s FROM %s%s%s%s%s%s%s;' % (
dst, fields, tables, whr, grp, order, limit, offset, upd)
return 'SELECT%s%s %s FROM %s%s%s%s%s;' % (
dst, limit, fields, tables, whr, grp, order, upd)

def left_join(self, val, query_env={}):
# Left join must always have an ON clause
Expand Down

0 comments on commit c707d55

Please sign in to comment.