我有4个字段(empno,jobcode,abscode,unittype),并希望在只有unittype不同时找到所有记录
答案 0 :(得分:2)
Select empno,jobcode,abscode,Count(unittype)
from Tab
Group by empno,jobcode,abscode
Having Count(unittype)>1
答案 1 :(得分:0)
几乎拥有它:
Select empno,jobcode,abscode,Count(Distinct unittype)
from Tab
Group by empno,jobcode,abscode
Having Count(Distinct unittype)>1