This commit is contained in:
Lunny Xiao 2015-01-13 17:17:34 +08:00
parent dcc529b68a
commit 66ba6f849e
1 changed files with 6 additions and 2 deletions

View File

@ -1233,8 +1233,12 @@ func (statement *Statement) genSelectSql(columnStr string) (a string) {
column = statement.RefTable.ColumnsSeq()[0]
}
}
mssqlCondi = fmt.Sprintf("(%s NOT IN (SELECT TOP %d %s%s%s))",
column, statement.Start, column, fromStr, whereStr)
var orderStr string
if len(statement.OrderStr) > 0 {
orderStr = " " + statement.OrderStr
}
mssqlCondi = fmt.Sprintf("(%s NOT IN (SELECT TOP %d %s%s%s%s))",
column, statement.Start, column, fromStr, whereStr, orderStr)
}
}