阅读 50

Flink基础(130):FLINK-SQL语法 (24) DQL(16) OPERATIONS(13)ORDER BY clause/LIMIT clause

1 ORDER BY clause 

Batch Streaming

The ORDER BY clause causes the result rows to be sorted according to the specified expression(s). If two rows are equal according to the leftmost expression, they are compared according to the next expression and so on. If they are equal according to all specified expressions, they are returned in an implementation-dependent order.

When running in streaming mode, the primary sort order of a table must be ascending on a . All subsequent orders can be freely chosen. But there is no this limitation in batch mode.

SELECT *
FROM Orders
ORDER BY order_time, order_id

2 LIMIT clause

LIMIT clause constrains the number of rows returned by the SELECT statement. In general, this clause is used in conjunction with ORDER BY to ensure that the results are deterministic.

The following example selects the first 3 rows in Orders table.

SELECT *
FROM Orders
ORDER BY orderTime
LIMIT 3

 

原文:https://www.cnblogs.com/qiu-hua/p/15195929.html

文章分类
代码人生
版权声明:本站是系统测试站点,无实际运营。本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容, 请发送邮件至 XXXXXXo@163.com 举报,一经查实,本站将立刻删除。
相关推荐