Apache Doris 中文技术论坛
Questions Tags Users Badges

Doris2.1.5查询排序后再LIMIT顺序会错乱

Asked Nov 20, 2024 Modified Jan 1, 0001
Viewed 47
2.1 query

mysql中写法

-- 这个查询结果是正常的。
select * from (select f1,f2,create_date from a order by create_date desc) t limit 50;

doris中这么写顺序会错乱
外面包这一层是有功能需要,暂时只能这么写,这种情况下如何保证t的内部是有序的呢?

edited Jan 1, 0001
Zhouxw44
asked Nov 20, 2024
1 Answers

该结果是正常的。在数据库标准里,subquery里的order by 实际是没意义的:
参考: https://mariadb.com/kb/en/why-is-order-by-in-a-from-subquery-ignored

edited Jan 1, 1970
阿渊@SelectDB8245
answered Nov 21, 2024
Related Questions
频繁使用 StreamLoader 接口导入大批量数据(几十亿至一百亿)出现性能明显下降,有无较好的实践?
1 answers
doris be崩溃 版本v2.1.7
1 answers
服务器异常关机导致表副本损坏,提示version_error
1 answers
通过Spark Doris Connector的方式访问Doris表,提示报错fragment_executor execute failed
2 answers
Routine Load kafka 连接数
1 answers
doris 2.1.6版本,执行sql脚本在将数据插入表中时报错字段不存在
1 answers

Terms of service Privacy policy

Powered by Answer - the open-source software that powers Q&A communities.
Made with love © 2025 Apache Doris 中文技术论坛.