Log in

View Full Version : unique items



NXArmada
05-29-2008, 04:56 PM
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', ''

boogyman
05-30-2008, 12:36 PM
%516%
put that in the WHERE clause of the statememt



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

NXArmada
06-02-2008, 09:03 PM
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%)

boogyman
06-03-2008, 01:22 PM
can you rephrase that?

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

NXArmada
06-03-2008, 03:27 PM
'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.