| 1234567891011121314151617181920212223242526272829303132333435 |
- -- ============================================================
- -- 子查询+聚合测试(跳过:服务器 parser 不支持子查询)
- -- ============================================================
- -- 1. 子查询中用聚合函数(服务器可能不支持 > (select ...))
- select * from /test/aaa/test_subquery where s_value > (select avg(s_value) from /test/aaa/test_subquery)
- /**
- onerror(continue,"After '","(select")
- output()
- **/
- ;
- -- 2. 子查询中用 count(服务器不支持 IN (select ...))
- select * from /test/aaa/test_subquery where s_type in (select s_type from /test/aaa/test_subquery group by s_type having count(*) > 1)
- /**
- onerror(continue,"After '","s_type in ('")
- output()
- **/
- ;
- -- 3. 子查询 group by(服务器可能不支持 > (select ...))
- select s_type, count(*) from /test/aaa/test_subquery where s_value > (select min(s_value) from /test/aaa/test_subquery where s_type='type_x') group by s_type
- /**
- onerror(continue,"After '","(select")
- output()
- **/
- ;
- -- 4. 子查询嵌套的聚合(服务器不支持 IN (select ...))
- select max(s_value) from /test/aaa/test_subquery where s_type in (select s_type from /test/aaa/test_subquery)
- /**
- onerror(continue,"After '","s_type in ('")
- output()
- **/
- ;
|