Results 1 to 2 of 2

Thread: Identical BOM's

  1. #1
    Join Date
    Jul 2003
    Location
    Michigan
    Posts
    1,941

    Unanswered: Identical BOM's

    I have a Bill Of Materials table with this structure

    Product
    Part
    Qty

    Of course, some products can have more parts than others.

    I'm trying to products that have identical BOM's, that is - same parts, and same qty of each part. I've been messing with it for a few hours, and now I don't think it's possible, but figured I'd ask here before I gave up.

    (I'm using SQL Server 2000 if that helps)
    Inspiration Through Fermentation

  2. #2
    Join Date
    Jan 2007
    Location
    Jena, Germany
    Posts
    2,721
    You can build a single table containing the BOM for all products and add 1 column for the product name if it is not yet in that table. Now you can join this table with itself. The first join checks that for all rows of product1 you will have a matching row for product2. You do the same with product2 -> product1. Whatever remains are the matching products. You may have to count the number of rows for each product before and after the filtering and then compare those numbers to make sure nothing was filtered-out during the row-wise comparison.
    Knut Stolze
    IBM DB2 Analytics Accelerator
    IBM Germany Research & Development

Posting Permissions

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