Вам нужно перевести это в рекурсивное общее табличное выражение:
with rcte(level, serial_number, table_, position, description, article, next_table, root_table)
as (
select 1, serial_number, table_, position, description, article, next_table, root_table
from bill_of_material
where serial_number = ABC.123.ZXC
-- Start with
and table_ = root_table
union all
select prev.level+1
, curr.serial_number
, curr.table_
, curr.position
, curr.description
, curr.article
, curr.next_table
, curr.root_table
from rcte prev
join bill_of_material curr
on prev.next_table = curr.table_
)
select * from rcte
order by level, table_, position