Avoid using LIMIT ALL. Omit LIMIT statement when a given value is not a number.

LIMIT ALL is not supported by most major SQL databases, i.e. MySQL,
SQLite. MS SQL Server and Oracle do not support LIMIT statement
completely.
Merge pull request #18 from temochka/limit-all-fix

Do not use LIMIT ALL