tmajor99
asked on
SQL Select to Group and Filter Data
I need a SQL that will list products in family have different descriptions. Every product within the same product family should always have the same description 01 and description 02 values. I need a SQL that will identify the products with a Family that does not have the same description 01 or description 02.
FamilyID ProductID Description01 Description02
A 12345 Iphone Apple IPhone
A 19332 Phone Apple
A 14913 Iphone Apple IPhone
B 94444 Ford Card Ford
B 98433 Ford Card Ford
From the example above, I need to report all the products in Product Family A because the Description 01 and Description 02 column data is different.
Report:
FamilyID ProductID Description01 Description02
A 12345 Iphone Apple IPhone
A 19332 Phone Apple
A 14913 Iphone Apple IPhone
FamilyID ProductID Description01 Description02
A 12345 Iphone Apple IPhone
A 19332 Phone Apple
A 14913 Iphone Apple IPhone
B 94444 Ford Card Ford
B 98433 Ford Card Ford
From the example above, I need to report all the products in Product Family A because the Description 01 and Description 02 column data is different.
Report:
FamilyID ProductID Description01 Description02
A 12345 Iphone Apple IPhone
A 19332 Phone Apple
A 14913 Iphone Apple IPhone
ASKER
Thanks but I need I to list products within the SAME family and that have different Description01 or Description02 values.
You have NOT really explained the problem. As just one example of that, would you want these rows listed in results?:
C 94444 Ford Ford Card
C 98433 Ford Card Ford
C 94444 Ford Ford Card
C 98433 Ford Card Ford
ASKER
Let me try to make this request easier. i just need a report that will list PRODUCTS within the SAME family that have a different DESCRIPTION01.
FamilyID ProductID Description01
A 12345 Iphone
A 19332 Book
A 14913 Iphone
B 94444 Ford Card
B 98433 Ford Card
In the example data above, I would only report the Products with Family A because there is a discrepancy in the Description01.
FamilyID ProductID Description01
A 12345 Iphone
A 19332 Book
A 14913 Iphone
FamilyID ProductID Description01
A 12345 Iphone
A 19332 Book
A 14913 Iphone
B 94444 Ford Card
B 98433 Ford Card
In the example data above, I would only report the Products with Family A because there is a discrepancy in the Description01.
FamilyID ProductID Description01
A 12345 Iphone
A 19332 Book
A 14913 Iphone
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Open in new window