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

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

Asked Nov 20, 2024 Modified Jan 1, 0001
Viewed 56
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
阿渊@SelectDB (没回帖直接加我主页微信)8970
answered Nov 21, 2024
Related Questions
fe节点加入集群时报错
1 answers
大佬们求助,授予角色可以创建catalog的权限报错
1 answers
关于catalog_paimon环境下如何启用paimonNativeReadSplits?
1 answers
不同doris集群如何同步数据?
1 answers
bitmap类型设置默认值后,数据导入报错can not cast from origin type bitmap to target type=varchar(65533)
1 answers
doris2.1.8,相同的sql,不同账期但数据量差异,大小表join,有时候会自动join reorder导致OOM
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 中文技术论坛.