Multi-level BOM BAQ

,

Yes, there are a few discussions/examples - using CTEs.
Here is a link to one Indented BOM SQL Query
I think you should be able to find a few others by searching for INDENTED or CTE