Hi,

I've created a little test schema:

<https://lh3.googleusercontent.com/-NbXRJ0AcjwE/V8nx1VPr3hI/AAAAAAAAAD8/a5B_lCt9JRoxsdeSRuUh4kCyyeThPyB_ACLcB/s1600/schema.jpg>


And used this query to find all products that was viewd but not ordered:


select from product where in("viewed").size() > 0 and in("ordered").size() = 
0


Hope it helps,

Alex.





Il giorno venerdì 2 settembre 2016 23:25:56 UTC+2, Tan Ho ha scritto:
>
> Hi all,
>
> Maybe this is a simple question for you but I was not able to find any 
> answer.
>
> I have some vertices of class 'product' which can be 'viewed', 'ordered' 
> by 'user'.
> My problem is that I want to get all product where 'viewed' by specific 
> user, and it's has not been 'ordered' by any user.
>
> Eg:  ProductA <-viewed- User1
>        ProductB <-viewed- User1
>        ProductC <-viewed- User1
>        ProductC <-ordered- User1
>        ProductD <-viewed- User1
>        ProductD <-viewed- User2
>        ProductD <-ordered- User2
>
> Input: User1
> Expected result:ProductA, ProductB
> Note: ProductC and ProductD don't exist in result set because they were 
> 'ordered' by User1, User2.
>
> I want to get it by using SQL or Match command.
>
> Thanks,
> Tan
>

-- 

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

Reply via email to