> is it possible in Cypher to get back nodes which have a given number
> of children? For example, I want to get all nodes which have exactly
> 5 children.
> I tried it this way:
> start n=node(*) match n-[r?]->m where count(m)=5 return n;
> But this produces the Exception:
> Exception in thread "main" Can't use aggregate functions in the WHERE
> clause. Move it to the HAVING clause.
> I can't find any information about a "HAVING" clause in the docs?
> is it possible in Cypher to get back nodes which have a given number
> of children? For example, I want to get all nodes which have exactly
> 5 children.
> I tried it this way:
> start n=node(*) match n-[r?]->m where count(m)=5 return n;
> But this produces the Exception:
> Exception in thread "main" Can't use aggregate functions in the WHERE
> clause. Move it to the HAVING clause.
> I can't find any information about a "HAVING" clause in the docs?
"start n=node(*) match n-->m with n, count(*) as children where
children = 20, return n, children"
^
at
org.neo4j.cypher.internal.parser.v1_7.CypherParserImpl.parse(CypherParserIm pl.scala:
66)
I downloaded the latest stable release and the libs are showing up:
neo4j-cypher-1.7.jar
neo4j-cypher-1.8.M01.jar
So, I need to download the 1.8 snapshot?
And thanks for this wonderful piece of software ;-)
On 4 Mai, 18:47, Andres Taylor <andres.tay...@neotechnology.com>
wrote:
> Ooops. Missed that. HAVING was planned and then scrapped. Michael's
> suggestion is the correct solution.
> Andrés
> On Fri, May 4, 2012 at 4:24 PM, Thomas <thomas.zast...@googlemail.com>wrote:
> > Hello,
> > is it possible in Cypher to get back nodes which have a given number
> > of children? For example, I want to get all nodes which have exactly
> > 5 children.
> > I tried it this way:
> > start n=node(*) match n-[r?]->m where count(m)=5 return n;
> > But this produces the Exception:
> > Exception in thread "main" Can't use aggregate functions in the WHERE
> > clause. Move it to the HAVING clause.
> > I can't find any information about a "HAVING" clause in the docs?
Thanks for your replies.
I tried the command and get the error:
"start n=node(*) match n-->m with n, count(*) as children where
children = 20, return n, children"
^
at
org.neo4j.cypher.internal.parser.v1_7.CypherParserImpl.parse(CypherParserIm pl.scala:
66)
I downloaded the latest stable release and the libs are showing up:
neo4j-cypher-1.7.jar
neo4j-cypher-1.8.M01.jar
So, I need to download the 1.8 snapshot?
And thanks for this wonderful piece of software ;-)
On 4 Mai, 18:47, Andres Taylor <andres.tay...@neotechnology.com>
wrote:
> Ooops. Missed that. HAVING was planned and then scrapped. Michael's
> suggestion is the correct solution.
> Andrés
> On Fri, May 4, 2012 at 4:24 PM, Thomas <thomas.zast...@googlemail.com>wrote:
> > Hello,
> > is it possible in Cypher to get back nodes which have a given number
> > of children? For example, I want to get all nodes which have exactly
> > 5 children.
> > I tried it this way:
> > start n=node(*) match n-[r?]->m where count(m)=5 return n;
> > But this produces the Exception:
> > Exception in thread "main" Can't use aggregate functions in the WHERE
> > clause. Move it to the HAVING clause.
> > I can't find any information about a "HAVING" clause in the docs?
> > Thanks for information ;-)
On 4 Mai, 18:47, Andres Taylor <andres.tay...@neotechnology.com>
wrote:
> Ooops. Missed that. HAVING was planned and then scrapped. Michael's
> suggestion is the correct solution.
> Andrés
> On Fri, May 4, 2012 at 4:24 PM, Thomas <thomas.zast...@googlemail.com>wrote:
> > Hello,
> > is it possible in Cypher to get back nodes which have a given number
> > of children? For example, I want to get all nodes which have exactly
> > 5 children.
> > I tried it this way:
> > start n=node(*) match n-[r?]->m where count(m)=5 return n;
> > But this produces the Exception:
> > Exception in thread "main" Can't use aggregate functions in the WHERE
> > clause. Move it to the HAVING clause.
> > I can't find any information about a "HAVING" clause in the docs?
> I downloaded the latest stable release and the libs are showing up:
> neo4j-cypher-1.7.jar
> neo4j-cypher-1.8.M01.jar
> So, I need to download the 1.8 snapshot?
> And thanks for this wonderful piece of software ;-)
> On 4 Mai, 18:47, Andres Taylor <andres.tay...@neotechnology.com>
> wrote:
> > Ooops. Missed that. HAVING was planned and then scrapped. Michael's
> > suggestion is the correct solution.
> > Andrés
> > On Fri, May 4, 2012 at 4:24 PM, Thomas <thomas.zast...@googlemail.com
> >wrote:
> > > Hello,
> > > is it possible in Cypher to get back nodes which have a given number
> > > of children? For example, I want to get all nodes which have exactly
> > > 5 children.
> > > I tried it this way:
> > > start n=node(*) match n-[r?]->m where count(m)=5 return n;
> > > But this produces the Exception:
> > > Exception in thread "main" Can't use aggregate functions in the WHERE
> > > clause. Move it to the HAVING clause.
> > > I can't find any information about a "HAVING" clause in the docs?
Something's wrong in your setup. You are using Cypher 1.7, judging by the
stack trace you provided. Can you try doing a clean install and copying the
database over?
Andrés
On Sat, May 5, 2012 at 6:16 PM, Thomas <thomas.zast...@googlemail.com>wrote:
> I downloaded the latest stable release and the libs are showing up:
> neo4j-cypher-1.7.jar
> neo4j-cypher-1.8.M01.jar
> So, I need to download the 1.8 snapshot?
> And thanks for this wonderful piece of software ;-)
> On 4 Mai, 18:47, Andres Taylor <andres.tay...@neotechnology.com>
> wrote:
> > Ooops. Missed that. HAVING was planned and then scrapped. Michael's
> > suggestion is the correct solution.
> > Andrés
> > On Fri, May 4, 2012 at 4:24 PM, Thomas <thomas.zast...@googlemail.com
> >wrote:
> > > Hello,
> > > is it possible in Cypher to get back nodes which have a given number
> > > of children? For example, I want to get all nodes which have exactly
> > > 5 children.
> > > I tried it this way:
> > > start n=node(*) match n-[r?]->m where count(m)=5 return n;
> > > But this produces the Exception:
> > > Exception in thread "main" Can't use aggregate functions in the WHERE
> > > clause. Move it to the HAVING clause.
> > > I can't find any information about a "HAVING" clause in the docs?
> Something's wrong in your setup. You are using Cypher 1.7, judging by the > stack trace you provided. Can you try doing a clean install and copying the > database over?
> Andrés
> On Sat, May 5, 2012 at 6:16 PM, Thomas <thomas.zast...@googlemail.com>wrote:
>> Thanks for your replies.
>> I tried the command and get the error:
>> "start n=node(*) match n-->m with n, count(*) as children where
>> children = 20, return n, children"
>> ^
>> at
>> And thanks for this wonderful piece of software ;-)
>> On 4 Mai, 18:47, Andres Taylor <andres.tay...@neotechnology.com>
>> wrote:
>> > Ooops. Missed that. HAVING was planned and then scrapped. Michael's
>> > suggestion is the correct solution.
>> > Andrés
>> > On Fri, May 4, 2012 at 4:24 PM, Thomas <thomas.zast...@googlemail.com
>> >wrote:
>> > > Hello,
>> > > is it possible in Cypher to get back nodes which have a given number
>> > > of children? For example, I want to get all nodes which have exactly
>> > > 5 children.
>> > > I tried it this way:
>> > > start n=node(*) match n-[r?]->m where count(m)=5 return n;
>> > > But this produces the Exception:
>> > > Exception in thread "main" Can't use aggregate functions in the WHERE
>> > > clause. Move it to the HAVING clause.
>> > > I can't find any information about a "HAVING" clause in the docs?