Use Labels ! and an index or constraint

create index on :Label(name_id);
OR
create constraint on (a:Label) assert a.name_id is unique;

*match(A:Label) *
*where A.name_id = '5250' *
*return size(**(A)-->()-->(:Label2)) + size(**(A)-->(:Label2)) as Q*


On Fri, Nov 14, 2014 at 8:33 PM, edo okati <[email protected]> wrote:

> Hello All,
> I am new to Neo4J, I am currently working on doing a POC on our data. I am
> working on a query but couldnt find a exact solution online. So posting a
> new thread here. Here is my requirement:
>
> *match(A)-->(B)-->(C) where a.name_id = '5250' return count(*) as QZ --
> Resulted in 500*
>
> *match(A)-->(C) where a.name_id = '5250' return count(*) as QA -- resulted
> in 600*
>
> now, I have two results QZ and QA, how can I combine query 1 and 2 and get
> 1100 as output?
>
> Hope question is clear enough, any questions, please reply.
>
> --
> 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.
>

-- 
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.

Reply via email to