Results 1 to 5 of 5

Thread: unique items

  1. #1
    Join Date
    Apr 2006
    Posts
    190
    Thanks
    3
    Thanked 7 Times in 7 Posts

    Default unique items

    I have 5 rows listed below 4 of the rows have the same part number. I have been trying for the last couple of weeks to come op with a query that only displays the first part number.

    What I want is to only display the part# that is unique to the %516% and in the case of the 5 rows below only row 1 (21304) is displayed.

    part# desc parent1 parent 2 parent 3

    'part#','desc','p1','p2','p3'
    '21304', 'AIR COIL (139)', '81931', '81932', ' 516TCXO'
    '23266', '', '81930', ' 516F', ''
    '23266', '', '81936', ' 566', ''
    '23266', '', '81936', ' 566AT', ''
    '23266', '', '81937', ' 516FTCXO', ''
    Ryan
    Sevierville, TN

  2. #2
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    %516%
    put that in the WHERE clause of the statememt

    Code:
    SELECT part, desc, p1, p2, p3 FROM table WHERE p1 LIKE %516%;

  3. #3
    Join Date
    Apr 2006
    Posts
    190
    Thanks
    3
    Thanked 7 Times in 7 Posts

    Default

    If I do that I get Rows 1,2, & 5 where as I only want row 1 cause Rows 2 - 5 have %566%

    I want a list of parts that is not used on other parent parts (P1,P2,P3) and in the case above %516% is used on both parts but Part 1 (Row1) is only used on the %516% where as the other part (Rows 2-5) are used on other Parent Parts (%566%)
    Ryan
    Sevierville, TN

  4. #4
    Join Date
    Jul 2006
    Location
    just north of Boston, MA
    Posts
    1,806
    Thanks
    13
    Thanked 72 Times in 72 Posts

    Default

    can you rephrase that?

    what you are saying doesn't make sense to me... I see unique values?

  5. #5
    Join Date
    Apr 2006
    Posts
    190
    Thanks
    3
    Thanked 7 Times in 7 Posts

    Default

    'part#','desc','p1','p2','p3'
    '21304', 'AIR COIL (139)', '81931', '81932', ' 516TCXO'
    '23266', '', '81930', ' 516F', ''
    '23266', '', '81936', ' 566', ''
    '23266', '', '81936', ' 566AT', ''
    '23266', '', '81937', ' 516FTCXO', ''

    If you see above in YellowGreen 21304 is use only on the %516% now if you look at Blue 23266 Is Used on %516% and %566%. So I am trying to make a query that only displays the Part# thats only used on the %516% and not the %566%.

    So in the case of the 5 rows above only Row 1 is displayed cause 21304 is unique to the %516% where as 23266 is not cause it is used on the %566% as well.
    Ryan
    Sevierville, TN

Bookmarks

Posting Permissions

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