Link to home
Start Free TrialLog in
Avatar of Pavlo
PavloFlag for Canada

asked on

TSQL: return only records which have only one type of value.

MS SQL Server table has following values:

ID Item Value
1 ItemA ValueA
2 ItemB ValueA
3 ItemB ValueB
4 ItemA ValueA
5 ItemC ValueC
6 ItemD ValueA

I need to build query which will return only items which have only ValueA in Value column, but do not have any other values.
So for the example above, result would be:
ItemA
ItemD

Thank you
ASKER CERTIFIED SOLUTION
Avatar of zephyr_hex (Megan)
zephyr_hex (Megan)
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial