with RTD1 as( select * from dbo.TabName ), RTD2 as( select * from RTD1 where id=1 union all select RTD1.* from RTD2 inner join RTD1 on RTD2.id=RTD1.PID ) select * from RTD2