SQLTeam.com | Weblogs | Forums

Selecting only certain id's


#1

i have a table where there a 3 ids the same but the indicator shows 0 or 1
so i need to return all three rows that have a indicators 0 and 1 have
and not the three rows indicators 1 and 1
eg
id name indicator
10 mr a 0
10 mrs a 1
11 mr b 1
11 mrs b 1

I only want to return Id 10 and not 11


#2
GROUP BY ID
HAVING MIN(indicator) <> MAX(indicator)