Results 1 to 4 of 4
  1. #1
    Join Date
    Aug 2003
    Posts
    2

    Arrow Unanswered: People Who bought X also bought Y,Z,R,D

    Hello,

    I need your help...

    I'm trying to build an application that will tell me what items usually sell along with an item we will call "X".

    I have a huge list of tickets with the following cells: ticket number, item code, amount of items sold, and date (which won't be needed)

    What I need is that when I select item 203923 e.g., the query will give me a list of 10 other items (in order of sales) which usually sell along with the first one.

    I would really appreciate anyone's help.

    Thanx

  2. #2
    Join Date
    Aug 2003
    Location
    Bosnia & Hercegovina
    Posts
    57
    first create query that will select only ticket numbers that have X item code, you only need ticket number field, save it.....

    create another query with your table and the new query with selected ticket numbers.....

    link those two by ticket number field using relation one-to-one....

    that's it......

  3. #3
    Join Date
    Apr 2002
    Location
    Toronto, Canada
    Posts
    20,002
    there's more to it than that, eh
    Code:
    select top 10
         , itemcode
         , sum(amtsold)
      from tickets
     where itemcode <> 203923 
       and ticketno in
           ( select ticketno
               from tickets
              where itemcode = 203923 )
    order
        by sum(amtsold) desc
    rudy
    http://r937.com/
    Last edited by r937; 08-18-03 at 12:55.

  4. #4
    Join Date
    Aug 2003
    Location
    Bosnia & Hercegovina
    Posts
    57
    I forgot about those top 10, it changes totally....


    sorry...

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •