Skip to content

Commit

Permalink
Merge pull request #2249 from swamp09/fix_columns_for_distinct
Browse files Browse the repository at this point in the history
  • Loading branch information
yahonda committed Jan 20, 2022
1 parent 0314d54 commit a111944
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -661,7 +661,7 @@ def columns_for_distinct(columns, orders) #:nodoc:
}.reject(&:blank?).map.with_index { |column, i|
"FIRST_VALUE(#{column}) OVER (PARTITION BY #{columns} ORDER BY #{column}) AS alias_#{i}__"
}
[super, *order_columns].join(", ")
(order_columns << super).join(", ")
end

def temporary_table?(table_name) #:nodoc:
Expand Down

0 comments on commit a111944

Please sign in to comment.