इसे आज़माएं (मैंने इसका परीक्षण नहीं किया है):
with t2 as (
select ColA2, ColB2, count(*) cnt
from TableTwo
group by ColA2, ColB2
)
select t1.Id1,
( select max(cnt) MaxDup
from t2
where t2.ColA2=t1.Id1)
from TableOne t1
इसे आज़माएं (मैंने इसका परीक्षण नहीं किया है):
with t2 as (
select ColA2, ColB2, count(*) cnt
from TableTwo
group by ColA2, ColB2
)
select t1.Id1,
( select max(cnt) MaxDup
from t2
where t2.ColA2=t1.Id1)
from TableOne t1