Reputation: 145
I have 4 fields (empno,jobcode,abscode,unittype) and want to find all the records when only the unittype is different
Upvotes: 1
Views: 65
Reputation: 1
Almost had it:
Select empno,jobcode,abscode,Count(Distinct unittype)
from Tab
Group by empno,jobcode,abscode
Having Count(Distinct unittype)>1
Upvotes: 0
Reputation: 27367
Select empno,jobcode,abscode,Count(unittype)
from Tab
Group by empno,jobcode,abscode
Having Count(unittype)>1
Upvotes: 2