Browse Source

fix distinct & top conflict on mssql

xormplus 8 năm trước cách đây
mục cha
commit
9684e30a2b
1 tập tin đã thay đổi với 1 bổ sung1 xóa
  1. 1 1
      statement.go

+ 1 - 1
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