Thanks for the response. I wasn't aware of the having clause before today. I appreciate your help.
On Monday, October 2, 2017 at 3:47:03 AM UTC-4, Luigi Dell'Aquila wrote: > > Hi, > > This is the same in old style RDBMS, you would have to use a HAVING it > this case, but OrientDB doesn't support HAVING, so you have to use a > subquery (that is what you are correctly doing) > > Thanks > > Luigi > > > 2017-09-29 21:09 GMT+02:00 <[email protected] <javascript:>>: > >> I am using orientdb version 2.2.0 and I have noticed that if I try to >> select a COUNT and do a where count > 5 on it, that the query returns >> nothing. For this to work I need to make it a subquery and then it works >> there. My data below is assuming that I have a vertex called User and Term >> with an edge called searched between them which contains some data such as >> employeeId and q which is just the term's value. >> >> The following is what I have to do to get it to work properly: >> select from (select employeeId, count(employeeId) from searched WHERE >> q.toLowerCase() LIKE '%metal%' group by employeeId ORDER BY count DESC) >> WHERE count >= 5 >> >> I would like to know why this doesn't work with the count part of the >> where. I also tried renaming the count to other values, but it doesn't >> matter what it is called: >> select employeeId, count(employeeId) from searched WHERE q.toLowerCase() >> LIKE '%metal%' and count > 4 group by employeeId ORDER BY count DESC >> >> I just don't understand why I have to use a subquery to get it to work >> properly. Can anybody please provide some insight on this issue? >> >> -- >> >> --- >> You received this message because you are subscribed to the Google Groups >> "OrientDB" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to [email protected] <javascript:>. >> For more options, visit https://groups.google.com/d/optout. >> > > -- --- You received this message because you are subscribed to the Google Groups "OrientDB" 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.
