From 8729bffe7425f302fd4f40ad8d405118e94d9d31 Mon Sep 17 00:00:00 2001 From: Lunny Xiao Date: Wed, 31 May 2017 09:01:50 +0800 Subject: [PATCH] fix distinct & top conflict on mssql (#596) --- statement.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/statement.go b/statement.go index b6f0baf2..3c9ac4e9 100644 --- a/statement.go +++ b/statement.go @@ -1278,7 +1278,7 @@ func (statement *Statement) genSelectSQL(columnStr, condSQL string) (a string) { } // !nashtsai! REVIEW Sprintf is considered slowest mean of string concatnation, better to work with builder pattern - a = fmt.Sprintf("SELECT %v%v%v%v%v", top, distinct, columnStr, fromStr, whereStr) + a = fmt.Sprintf("SELECT %v%v%v%v%v", distinct, top, columnStr, fromStr, whereStr) if len(mssqlCondi) > 0 { if len(whereStr) > 0 { a += " AND " + mssqlCondi