Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
matt.orme
Starting Member
23 Posts |
Posted - 2009-01-02 : 13:09:00
|
Hello -I am working on putting together a table of related products based on previous sales history. For example, I would like to know that when a hammer is purchased, the items most likely to be purchased simultaneously are nails and a tool belt.In terms of data, I have a table which contains a ticket number and a product (SKU) field. The following is a selection:ID Ticket SKU236657 215401 10598140236656 215401 11004400236658 215403 10289170236659 215403 10288525236668 215403 10444640236667 215403 10324060236666 215403 10288475236665 215403 10289200236663 215403 10695290236661 215403 10695290236660 215403 10289200236662 215403 10288525236664 215403 10288525236672 215404 10711100236673 215405 105446535190 215405 105446535176 215405 105446535196 215406 20015505195 215406 103134705194 215406 2553505197 215406 20920545198 215407 618175905199 215408 226655200 215408 22676I am looking for a way that I can know for each distinct SKU what the top 5 related products are, based on these data. Ideally this would get written to another table.The table name with the given data is called "Related".Thanks in advance for your help |
|
|
|
|