【发布时间】:2010-01-18 10:16:00
【问题描述】:
我现在使用slope One 进行推荐。
如何从结果中排除访问过的项目?
我不能简单地通过not in (visited_id_list) 来过滤那些访问过的,因为这对于老用户来说会存在可扩展性问题!
我想出了一个没有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;
【问题讨论】:
-
你是在 SQL 中实现这个吗?如果没有,您的数据是如何存储的?如果您要提取所有数据,对其进行处理,然后将其呈现出来……那么您将遇到更大的问题。
-
是的,我正在 MySQL 中实现它。
标签: algorithm recommendation-engine