Page is a not externally linkable
physics - 11:58 pm on Jun 27, 2006 (gmt 0)
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.
I don't know about a query but an algo might be something like:
Customer likes items A_i