Subject Re: [firebird-support] What is the SQL standard for FIRST/SKIP syntax?
Author Ann Harrison
David Garamond wrote:

>I am not familiar with SQL standards.
Happy man...

> Looking at
> it
>says that FIRST is a keyword, and so is LIMIT, but SKIP is not.
The SQL standard requires that keywords be rejected as table and field
names, even if the most idiotic of parsers could recognize from context
whether the work is being used as part of the sql language or as the
name of something. As a result, almost all new features break old
databases. Yaffil took the pragmatic approach that only keywords that
cannot be identified in context by a moderately intelligent parser
should be reserved. That's an issue we will need to revisit as we
integrate Yaffil back into Firebird. Pragmatically, it makes sense, but
it's not standard and will increase the difficulty of moving an
application from Firebird to other databases. (Why doesn't that bother
me as much as it should?)

>What is
>the standard SQL syntax for SKIP, or does the standard not cover
>skipping (since MS SQL doesn't seem to support SKIP-like feature)?
There isn't a standard for first/skip/limit, etc., in part because the
restriction has implications on other parts of the language. The
standard does not allow order by clauses in subqueries. Without order
by first/skip doesn't make much sense.

>I have to say, though, that FIRST/SKIP is the best/clearest syntax
>(especially compared to MySQL's more obscure LIMIT x,y).
I can't wait to tell Monty. He's given me lots of grief about inventing
a new syntax.