From bc719464938662572b01de579333e8c6cf662570 Mon Sep 17 00:00:00 2001 From: zengjirui Date: Sat, 30 Jun 2018 15:59:15 +0800 Subject: [PATCH] fix `top` expression --- lib/mssql_ecto/query_string.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/mssql_ecto/query_string.ex b/lib/mssql_ecto/query_string.ex index 16abc98..909e187 100644 --- a/lib/mssql_ecto/query_string.ex +++ b/lib/mssql_ecto/query_string.ex @@ -41,7 +41,7 @@ defmodule MssqlEcto.QueryString do end def top(%Query{offset: nil, limit: %QueryExpr{expr: expr}} = query, sources) do - [" TOP ", expr(expr, sources, query)] + [" TOP(", expr(expr, sources, query), ")"] end def top(_, _) do