I am trying to return the results of products in the table of products that have not been added by the current user and that the current user has not yet viewed, and then sort by products that have the smallest reviews showing those who do not have the first.
tblUsers :
UserID 1 2 3
tblProducts :
ProductID UserID (created) NumberReviews --------- ---------------- ------------- 1 1 1 2 1 0 3 2 1 4 1 2 5 2 0
tblReviews :
ReviewID UserID(reviewed) ProductID -------- ---------------- --------- 1 2 4 2 1 3 3 3 4 4 3 1
So, for the current user from 2, I want to return
Product ID ---------- 2 1
I tried several different left associations, but to no avail. Any ideas?
source share