Instantly share code, notes, and snippets.
For a given customer's purchase history what products do you recommend?
SELECT customer.Name AS CUSTOMER , demo.Name AS DEMOGRAPHIC , product.Name AS BECAUSE_OF_PURCHASE , recommendation.Name AS WE_RECOMMEND_PRODUCT FROM Customer AS customer , is_in , Demographic AS demo , purchased , Product AS product , recommends , Product AS recommendation WHERE MATCH(demo<-(is_in)-customer-(purchased)->product-(recommends)->recommendation) AND recommends.DemographicId = demo.Id AND customer.Id in (13) ORDER BY 1
Sorry, something went wrong.
For a given customer's purchase history what products do you recommend?