with recursive result
as
(select res_id,phy_res_code,res_name from tbl_res where parent_res_id = (select res_id from tbl_res where phy_res_code = 'org@96000#20211203155858') and res_type_id = 1 union all select t1.res_id, t1.phy_res_code, t1.res_name from tbl_res t1, result where t1.parent_res_id=result.res_id and res_type_id = 1
)
select res_id,phy_res_code,res_name
from result
where res_id <> (select res_id from tbl_res where phy_res_code = 'org@96000#20211203155858');
DM SQL
with result(res_id, phy_res_code, res_name)
as
(select res_id,phy_res_code,res_name from tbl_res where parent_res_id = (select res_id from tbl_res where phy_res_code = 'org@96000#20211203155858') and res_type_id = 1 union all select t1.res_id, t1.phy_res_code, t1.res_name from tbl_res t1, result where t1.parent_res_id=result.res_id and res_type_id = 1
)
select res_id,phy_res_code,res_name
from result
where res_id <> (select res_id from tbl_res where phy_res_code = 'org@96000#20211203155858');