Page is a not externally linkable
- Code, Content, and Presentation
-- Databases
---- Suggestion Query


physics - 11:58 pm on Jun 27, 2006 (gmt 0)


I don't know about a query but an algo might be something like:
Customer likes items A_i

For each A_i find all customers who also like A_i, store in array C

Loop through array C and find all other things those customers liked, store in hash L (item sku is key, how many of them liked each thing is value)

Return the hash L sorted by the number of people who liked each thing.

If you have a lot of customers and products this will take time so you might do it nightly and store the results for each customer in a seperate table.


Thread source:: http://www.webmasterworld.com/databases_sql_mysql/594.htm
Brought to you by WebmasterWorld: http://www.webmasterworld.com