[#7518] TOP (n) in SQL Server

This commit is contained in:
lukaseder 2018-11-28 14:27:04 +01:00
parent 48cb8da5f1
commit 9b50c5d4c4

View File

@ -1099,7 +1099,13 @@ final class ParserImpl implements Parser {
// T-SQL style TOP .. START AT
if (parseKeywordIf(ctx, "TOP")) {
int parens;
for (parens = 0; parseIf(ctx, '('); parens++);
limit = parseUnsignedInteger(ctx);
for (; parens > 0 && parse(ctx, ')'); parens--);
percent = parseKeywordIf(ctx, "PERCENT") && ctx.requireProEdition();
if (parseKeywordIf(ctx, "START AT"))