答案 0 :(得分:0)
使用in
select * from t where
iServiceodom in
( select iServiceodom
from t
where sLossCode='REVSTD')
答案 1 :(得分:0)
您可以使用EXISTS
:
SELECT t.*
FROM table t
WHERE EXISTS (SELECT 1
FROM table t1
WHERE t1.scontractnumber = t.contractnumber AND t1.iServiceOdom = t.iServiceOdom AND t1.slosscode='REVSTD'
);