awesomeleo opened a new issue, #44271: URL: https://github.com/apache/doris/issues/44271
### Search before asking - [X] I had searched in the [issues](https://github.com/apache/doris/issues?q=is%3Aissue) and found no similar issues. ### Version doris 2.0.9 ### What's Wrong? 嵌套子查询,在第三层以上的子查询不能访问父节点的父节点定义的表的别名 ### What You Expected? MySQL可以执行,希望Doris也能正常执行 ### How to Reproduce? CREATE TABLE `customers` ( `cust_id` int(11) NOT NULL, `cust_name` varchar(150) NOT NULL ) ENGINE=OLAP UNIQUE KEY(`cust_id`) COMMENT 'OLAP' DISTRIBUTED BY HASH(`cust_id`) BUCKETS 10 PROPERTIES ( "replication_allocation" = "tag.location.default: 1", "is_being_synced" = "false", "storage_format" = "V2", "light_schema_change" = "true", "disable_auto_compaction" = "false", "enable_single_replica_compaction" = "false" ); CREATE TABLE `orderitems` ( `order_num` int(11) NOT NULL, `order_item` int(11) NOT NULL, `prod_id` varchar(30) NOT NULL ) ENGINE=OLAP UNIQUE KEY(`order_num`, `order_item`) COMMENT 'OLAP' DISTRIBUTED BY HASH(`order_num`, `order_item`) BUCKETS 10 PROPERTIES ( "replication_allocation" = "tag.location.default: 1", "is_being_synced" = "false", "storage_format" = "V2", "light_schema_change" = "true", "disable_auto_compaction" = "false", "enable_single_replica_compaction" = "false" ); CREATE TABLE `orders` ( `order_num` int(11) NOT NULL, `order_date` datetime NOT NULL, `cust_id` int(11) NOT NULL ) ENGINE=OLAP UNIQUE KEY(`order_num`) COMMENT 'OLAP' DISTRIBUTED BY HASH(`order_num`) BUCKETS 10 PROPERTIES ( "replication_allocation" = "tag.location.default: 1", "is_being_synced" = "false", "storage_format" = "V2", "light_schema_change" = "true", "disable_auto_compaction" = "false", "enable_single_replica_compaction" = "false" ); select cust_name, cust_id from customers cm where cust_id in (select cust_id from orders where order_num in ( select order_num from orderitems where prod_id = 'TNT2' and cm.cust_name='Place')); 执行报错: ERROR 1105 (HY000): errCode = 2, detailMessage = errCode = 2, detailMessage = errCode = 2, detailMessage = Unknown column 'cust_name' in 'cm' ERROR 1064 (HY000): Getting analyzing error. Detail message: Column 'test.cm.cust_name' cannot be resolved. 把cm.cust_name='Place' 移到上一层就可以执行 select cust_name, cust_id from customers cm where cust_id in (select cust_id from orders where order_num in ( select order_num from orderitems where prod_id = 'TNT2')) and cm.cust_name='Place' ; ### Anything Else? _No response_ ### Are you willing to submit PR? - [ ] Yes I am willing to submit a PR! ### Code of Conduct - [X] I agree to follow this project's [Code of Conduct](https://www.apache.org/foundation/policies/conduct) -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@doris.apache.org For additional commands, e-mail: commits-h...@doris.apache.org