SELECT a.ID1,b.ID2
from
(
select row_number() over( order by ID)as No1, ID as ID1
from dbo.A
where ID<>'A')a
left OUTER join
select row_number() over(order by ID)as No1, ID as ID2
where ID<>'ADS'
)b
ON a.No1=b.No1