I'm now using slope One for recommendation.
How to exclude visited items from result?
I can't do it simply by not in (visited_id_list)
to filter those visited ones because it will have scalability issue for an old user!
I've come up with a solution without not in
:
select b.property,count(b.id) total from propertyviews a
left join propertyviews b on b.cookie=a.cookie
left join propertyviews c on c.cookie=0 and b.property=c.property
where a.property=1 and a.cookie!=0 and c.property is null
group by b.property order by total;