with tb(序号,name,Freq) as
(
select 序号,Name,Freq
from
(select Row_NUmber() over (order by name) '序号',name,Freq from @tb where Freq=900
union all
select Row_NUmber() over (order by name) '序号',name,Freq from @tb where Freq=1800) as tb
)
select name,Freq from tb
where 序号 in (select 序号 from tb group by 序号 having count(*)=2)
order by 序号,Freq