Open jecyyu opened 7 years ago
嵌套子查询现在好像不支持
As far as I know, elasticsearch doesn't support subqueries. you would need to perform your first query, then construct a second query using the results of the first query as an input
@shi-yuan Sorry, but could I ask how to use the results as an input? Like temporary table or something?
SELECT * FROM test/dog WHERE holdersName IN (SELECT firstname FROM test/account WHERE firstname = 'Hattie') AND age IN (SELECT name.ofHisName FROM test/gotCharacters WHERE name.firstname <> 'Daenerys')
@shi-yuan Thanks a lot! If I want to do something like:
select sum(gms), A
from (
select max(gms) as gms, A, B
from test
group by A, B
)
group by A
Is there any way possible?
I resolved this one by Pipeline aggregations. @shi-yuan Thank you all the same 😀 Hope you can implement this feature.
@treecy select sum(gms), A from ( select max(gms) as gms, A, B from test group by A, B ) group by A 你举的例子中,用Pipeline aggregations怎么写的 能提供下吗
@treecy May I ask how to do this: select count(*) cnt from (select a0.name from worker a0) ttt
需要满足的语句是: select from ( select media,province,age,sex,count()as counts from mahad where sex in ('02401') GROUP BY media,province,age,sex)