lava-oushudb-dt-sql-parser/test/parser/spark/syntax/fixtures/selectLimit.sql
Frank d0ad381833
test: spark sql query syntax unit test (#173)
* test: add spark query unit test and check grammar

* test: add select explain、lateralSubQuery、transform unit test

* chore: fileName exchange

---------

Co-authored-by: dilu <dilu@dtstack.com>
2023-10-10 16:25:43 +08:00

14 lines
476 B
SQL

-- LIMIT { ALL | integer_expression }
-- Select the first two rows.
SELECT name, age FROM person ORDER BY name LIMIT 2;
-- Specifying ALL option on LIMIT returns all the rows.
SELECT name, age FROM person ORDER BY name LIMIT ALL;
-- A function expression as an input to LIMIT.
SELECT name, age FROM person ORDER BY name LIMIT length('SPARK');
-- A non-foldable expression as an input to LIMIT is not allowed.
SELECT name, age FROM person ORDER BY name LIMIT length(name);