The obvious way of doing this is to query the details of orders that included the current item being viewed. For example, the following SQL will return the top five other products that were ordered alongside product 59 (Raclette Courdavault) from the
Northwind sample database:
SELECT ProductName FROM Products WHERE ProductID IN (
SELECT TOP 6 ProductID From [Order Details] WHERE OrderID IN (
SELECT OrderID From [ORDER Details] WHERE ProductID = 59
)
Group By ProductID ORDER BY Count(ProductID) DESC
) AND ProductID <> 59
The result will be the most frequently purchased products alongside Raclette Cordavault (whatever that is).
The obvious way of doing this is to query the details of orders that included the current item being viewed. For example, the following SQL will return the top five other products that were ordered alongside product 59 (Raclette Courdavault) from the
Northwind sample database:
SELECT ProductName FROM Products WHERE ProductID IN (
SELECT TOP 6 ProductID From [Order Details] WHERE OrderID IN (
SELECT OrderID From [ORDER Details] WHERE ProductID = 59
)
Group By ProductID ORDER BY Count(ProductID) DESC
) AND ProductID <> 59
The result will be the most frequently purchased products alongside Raclette Cordavault (whatever that is).
Thank you very much. That's definitely a good idea. I have been wondering if there is a 3rd party framework that has such functionalities built in.
antonyliu200...
Member
168 Points
310 Posts
How to do product suggestion like that of amazon?
Feb 17, 2013 03:47 PM|LINK
Mikesdotnett...
All-Star
154927 Points
19867 Posts
Moderator
MVP
Re: How to do product suggestion like that of amazon?
Feb 17, 2013 07:55 PM|LINK
The obvious way of doing this is to query the details of orders that included the current item being viewed. For example, the following SQL will return the top five other products that were ordered alongside product 59 (Raclette Courdavault) from the Northwind sample database:
The result will be the most frequently purchased products alongside Raclette Cordavault (whatever that is).
Beginning ASP.NET Web Pages with WebMatrix | My Site | Twitter
antonyliu200...
Member
168 Points
310 Posts
Re: How to do product suggestion like that of amazon?
Feb 17, 2013 09:16 PM|LINK
Thank you very much. That's definitely a good idea. I have been wondering if there is a 3rd party framework that has such functionalities built in.