Skip to content

Commit 444da38

Browse files
committed
Merged pull request #91 from bpokosh/master.
Select DISTINCT with limit and offset problem
2 parents 29e7e5d + 39e11f6 commit 444da38

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/arel/visitors/sqlserver.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -283,7 +283,7 @@ def rowtable_projections(o)
283283
core.projections.map do |x|
284284
x.dup.tap do |p|
285285
p.sub! 'DISTINCT', "DISTINCT #{visit(o.limit)}".strip if o.limit
286-
p.sub! /\[#{tn}\]\./, '[__rnt].'
286+
p.gsub! /\[?#{tn}\]?\./, '[__rnt].'
287287
p.strip!
288288
end
289289
end

0 commit comments

Comments
 (0)