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.

 All Forums
 Other Forums
 MS Access
 Related Products Table

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 SKU
236657 215401 10598140
236656 215401 11004400
236658 215403 10289170
236659 215403 10288525
236668 215403 10444640
236667 215403 10324060
236666 215403 10288475
236665 215403 10289200
236663 215403 10695290
236661 215403 10695290
236660 215403 10289200
236662 215403 10288525
236664 215403 10288525
236672 215404 10711100
236673 215405 10544653
5190 215405 10544653
5176 215405 10544653
5196 215406 2001550
5195 215406 10313470
5194 215406 255350
5197 215406 2092054
5198 215407 61817590
5199 215408 22665
5200 215408 22676

I 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
   

- Advertisement -