i have the below script, but it tells me
Types don't match between the anchor and the recursive part in column "QtyPer" of recursive query "CTE".
can anyone advise what could be wrong ? QtyPer is of type decimal
with CTE as (
select * from BOMTable
where [Level] = 1
union all
select a.TopLevel, a.Level, a.Assembly, a.Component, a.QtyPer *b.QtyPer, a.Route
from BOMTable a
inner join CTE b on a.TopLevel = b.TopLevel and a.Assembly = b.Component
)
select * from CTE where TopLevel ='20500068'