neo4j - Issue combining two cypher queries with UNION -
When combining two cyber questions on the query I ran into the following problem: by Friends_core works fine, like Now when I use the I get an error Can someone provide me an explanation Why these query results can not be collected and how to do this properly? Both questions run separately But why is the identifier identifiable in a unions-joint query? edit < P> The following simple query is basically equivalent, except that the second query in In addition, the second query has a segment with each other, because you have an order by clause (like MATCH (P1: Crew) - [R_PPQ] - & gt; (FQ: Crew) WHERE fq.name IN ["NEO", "Morphius"] Returns as a separate (P1) person, count as friend (R_PPQ) friend_core, submit (fq.name) friends form In DESC LIMIT 10
MATCH (f: crew) and lt; Weighing weight as a separate (F), count (R_FQ) with WHERE fq.name IN ["Neo", "Morphius"] - weight by weight ORDER DESC limited 10 matches - [R_FQF] - [R_FQF] lt; - (P: Crew) Returns as a separate (P) person, as the amount (weight) Friends_core, Friend (FNN) friend as friend_score DESC LIMIT 10
Union command, i.e.
match (P1: Crew) - [R_PPQ] - & gt; (FQ: Crew) query results [Neo "," Morphius "] by using WHERE fq.name as a separate (P1) person, counting (R_PFQ) as friend_core, collected (fq.name) friend's The friend OR_SECOR E DECSC limit 10 union match (F: Crew) <- [R-FQF] - (FQ: Crew) WHERE fq.name IN ["Neo", "Morphius" Weight in the form of count (R_FKF) by ORDER Weight DESC Ltd in FIFA 10 Lights; - (P: Crew) Returns different ( P) AS person, as the MSI (Association), Amount (Weight), Collect (FNNA) as a friend by MDIScore DESC Sirius Order 10
Error: org.neo4j.graphdb.NotFoundException: unknown identifier `weight`.
UNION is not ORDER BY
weight that's because we first Since the order derived by
friend_score , it seemed redundant, as well as in order of the variables to be included in the order by clause It should be in the return clause - but the first query in the union does not contain the
weight variable, which violates the requirements for a valid union statement.
friend_score ) before return section!
match (p1: crew) - [rppqad] -> (fq: crew) WHERE fq.name IN ["node", "morphius"] return difference (p1) In the form, Friends_core as the count (R_PPQ), Submit (fq.name) Friends_Score DESC Limited 10 Union Match (P: Crew) as Friend - & gt; (F: The crew) - [RFFF] - (FQ: Crew) where the F.C.N [INN ["Neo", "Morphius"] with F, Count (R_FQ) AS Weight, F with P, Yoga (Load) In the form of Friends_core, P Return Distinct (P), the person, friend_our, collect (DISTINCT (f) .name) as Friends DESC LIMIT 10 / html>
Comments
Post a Comment