I've built a query generator to generate subquerys on which I can access specific data which is related to the user, but does not contain the user information directly.
user->user_has_profiles->profile The query will return profiles for example.
Since one user can have multiple profiles the amount of results of this query might be amount_of_users * 0-n
I'd like to only return results if at least 5 users where involved in my query.
I found this for sqlite / mysql SQL syntax: select only if more than X results but since neither join nor having is available for orientDB I'm interested if there is any solution for this.
Example part of the query
select expand(rid) from (
select person_id, last(rid) as rid from (
select in('person_owns_profile').person_id as person_id, @rid as rid, valid_from from (
select from (
I tried with these records.
This is the graph.
I used this query
select from (select from profile) let $b= (select count(*) from user) where $b.count>5
Hope it helps.
You can use also this query
select from (select from profile) where "true" in (select if(eval(" count > 2"), "true", "false") from (select count(*) from user))