I don't get unknown error with this query You can't aggregate count(A) and return A at the same time same for r if you want to aggregate on A you have to at least use collect(r)
In this case you don't really need the WITH but I think you're aware of that. And you probably want to order DESC > MATCH (P:Player)-[r]->(A:App) > WITH P, COUNT(A) AS degree, collect(r) as rels, collect(A) as apps > ORDER BY degree > LIMIT 500 > RETURN P.id, degree, apps > Am 27.01.2015 um 13:19 schrieb Mowi <[email protected]>: > > Thanks for the fast answer!! Actually, I tried it with "WITH" but every time > I got "Unknown error". This is my query: > > MATCH (P:Player)-[r]->(A:App) > WITH P, r, A, COUNT(A) AS degree > ORDER BY degree > LIMIT 500 > RETURN P.id, COUNT(A) AS degree > > Do you have an idea what's wrong? > > Mowi > > > > > > > reduce input with WHERE > > MATCH (P:Player)-[r]->(A:Appln) > WHERE P.person_name < "B" > WITH P, r, A, COUNT(DISTINCT(A)) AS no_inventions > ORDER BY no_inventions > LIMIT 25 > MATCH (P:Player)-[r1]->(A:Appln)<-[r2]-(P2:Player) > RETURN P.nperson_id, P2.nperson_id, COUNT(DISTINCT(A)) AS no_inventions > > Am Dienstag, 27. Januar 2015 09:12:39 UTC+1 schrieb Michael Hunger: > Right now it can't > We want and plan to have that at some point but we're not there yet. > > You can use WITH <http://neo4j.com/docs/stable/query-with.html> to simulate > such a thing though. > > Cheers, Michael > >> Am 26.01.2015 um 15:35 schrieb Mowi <ot...@ <>mapegy.com >> <http://mapegy.com/>>: >> >> Hi all! >> >> I'd like to know quite the same! Is it possible to use Cypher to return a >> subgraph, so it can be used in another query? Or can I combine two queries >> like this: first, get a limited number of nodes and second, sort them or >> whatever and finally return them? >> >> Thanks for your help! >> >> Mowi >> >> >> >> >> >> Am Dienstag, 24. Januar 2012 15:22:41 UTC+1 schrieb Gonzalo Díaz: >> Hello! >> >> SQL returns tables which are a specific case of a database, so SQL's output >> can be used as input for a new query. >> >> I would like to know if it's possible to use Cypher to return a subgraph of >> my graph, so it can be used in another query. >> >> As an example, I have the following situation: >> >> All nodes have only one outward connection, but can have any number of >> incoming connections. >> >> The query consists of the following: I am given a set of starting nodes and >> a goal node. I am asked to show "paths" from the starting nodes to the goal >> node. I place paths in quotes because a "path" in my case is a subgraph >> where there is a path from every starting node to the goal node. >> >> Thanks! >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Neo4j" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to neo4j+un...@ <>googlegroups.com <http://googlegroups.com/>. >> For more options, visit https://groups.google.com/d/optout >> <https://groups.google.com/d/optout>. > > > -- > You received this message because you are subscribed to the Google Groups > "Neo4j" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to [email protected] > <mailto:[email protected]>. > For more options, visit https://groups.google.com/d/optout > <https://groups.google.com/d/optout>. -- You received this message because you are subscribed to the Google Groups "Neo4j" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. For more options, visit https://groups.google.com/d/optout.
