landbase-org / landbase

2023 Oceanbase miniob repo
Mulan Permissive Software License, Version 2
3 stars 0 forks source link

complex-sub-query #13

Closed Selflocking closed 10 months ago

Selflocking commented 11 months ago

赛题描述

实现复杂子查询功能。

复杂子查询是简单子查询的升级。与其最大的不同就在于子查询中会跟复查询联动。注意需要考虑查询条件中带有聚合函数的情况。

示例:

select * from t1 where age in (select id from t2 where t2.name in (select name from t3));

赛题地址

https://open.oceanbase.com/train/TopicDetails?questionId=600004&subQesitonId=800021&subQuestionName=complex-sub-query

往年详情

2022年

子查询在where条件中,子查询语句支持多张表与and和or条件表达式,查询条件支持max/min等。 注意考虑子查询与父表相关联的情况。 测试用例示例:

select * from t1 where age in (select id from t2 where t2.name in (select name from t3));

https://open.oceanbase.com/train/TopicDetails?questionId=500003&subQesitonId=700066&subQuestionName=complex-sub-query

2021年

子查询在WHERE条件中,子查询语句支持多张表与AND条件表达式,查询条件支持max/min等。

注意考虑一下子查询与父表相关联的情况。

https://open.oceanbase.com/train/TopicDetails?questionId=200001&subQesitonId=400016&subQuestionName=complex-sub-query

Selflocking commented 10 months ago

IMG_20231106_024920

IMG_20231106_024955