Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

aggregation § on subquery page #949

Open
v2belleville opened this issue Apr 22, 2024 · 3 comments
Open

aggregation § on subquery page #949

v2belleville opened this issue Apr 22, 2024 · 3 comments

Comments

@v2belleville
Copy link

hi,

On the subqueries page, the example given for § aggregation https://neo4j.com/docs/cypher-manual/current/subqueries/call-subquery/
#call-aggregation

returns the same with or without a subquery

image

Which seem contradictory with the first sentence "Returning subqueries change the number of results of the query."

as a result, I can not figure what this § is about ...

@JPryce-Aklundh
Copy link
Contributor

Thank you for raising this, @v2belleville - we will look into it.

@dmoree
Copy link

dmoree commented May 22, 2024

@v2belleville
Your second query seems invalid as c is not defined.

The statement:

Returning subqueries change the number of results of the query.

is correct, although it is slightly confusing because there doesn't seem to be enough context; particularly about what query is changed and from what.

The query that is being referred to is actually:

MATCH (p:Person)
RETURN p.name

This query returns 4 rows. This is the query that is being referred to as the enclosing query.

Original Query

After adding the subquery the number of rows is changed because some do not result in a match.

Query with Subquery

This is due to Charlie and Dora having no friends unfortunately. So the result isn't friend as say null; but rather that Charlie and Dora disappear.

Ultimately, this section also seems out of place under the heading "Aggregations" since no aggregating functions are being used. It seems like it would function better under a separate section like "Cardinality".

@v2belleville
Copy link
Author

v2belleville commented May 25, 2024

hi, thanks for the feed back.

In my second screenshot, I've apparently pasted the wrong query. What I meant is this one :
image

that returns the same result than with no sub-query

image

which makes it difficult to see the point in using a sub-query in this case

I now see a query with an aggregation, but it also returns the same result as with no sub-query, so, it's still difficult to see why we should use a sub-query in those cases, and conversely, what are the contexts in which it make sense to use such sub-queries
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants