Sql: SqlExp: .Limit(n) in MSSQL emulated using TOP

git-svn-id: svn://ultimatepp.org/upp/trunk@7805 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-10-20 18:43:25 +00:00
parent 222a370074
commit 1b23228d8b

View file

@ -115,7 +115,10 @@ SqlSelect& SqlSelect::NoWait() {
}
SqlSelect& SqlSelect::Limit(int limit) {
text << " limit " << limit;
ASSERT(text.StartsWith("select "));
String s = AsString(limit);
text.Insert(6, SqlCase(MSSQL, " top " + s)());
text << SqlCase(MSSQL, "")(" limit " + s);
return *this;
}