Merge branch 'master' of github.com:go-xorm/xorm

This commit is contained in:
Lunny Xiao 2015-01-23 17:08:57 +08:00
commit 72f04dadd8
1 changed files with 6 additions and 2 deletions

View File

@ -1239,8 +1239,12 @@ func (statement *Statement) genSelectSql(columnStr string) (a string) {
if len(statement.OrderStr) > 0 {
orderStr = " ORDER BY " + statement.OrderStr
}
mssqlCondi = fmt.Sprintf("(%s NOT IN (SELECT TOP %d %s%s%s%s))",
column, statement.Start, column, fromStr, whereStr, orderStr)
var groupStr string
if len(statement.GroupByStr) > 0 {
groupStr = " GROUP BY " + statement.GroupByStr
}
mssqlCondi = fmt.Sprintf("(%s NOT IN (SELECT TOP %d %s%s%s%s%s))",
column, statement.Start, column, fromStr, whereStr, orderStr, groupStr)
}
}