You starting line indicates that you probably don’t have OMOPed data but you want to only use OMOP Vocab to get a nice NDC-based lkup table.
You need to download the vocabulary and make sure you have it in a database and indexed. The joins in the query below can be slow if not indexed.
Consider a similar query (for ATC) that was “walking” the realtionships just like you need to do too.
atc.concept_id as atc_id, atc.concept_name as atc_name, atc.concept_code as atc_code, atc.concept_class_id as atc_class,
ndc.concept_id as ndc_id, ndc.concept_name as ndc_name, ndc.concept_code as ndc_code, ndc.concept_class_id as ndc_class
from concept atc
join concept_ancestor a on a.ancestor_concept_id=atc.concept_id
join concept_relationship r on r.concept_id_1=a.descendant_concept_id and r.invalid_reason is null and r.relationship_id='Mapped from'
join concept ndc on ndc.concept_id=concept_id_2 and ndc.vocabulary_id='NDC'
Your starting point should be different. The query above starts with concept table and the ATC vocab. You may want to start with branded drugs or all ingredients.
For each join - study on what it joins.
If you struggle, ask for further help. Once finished, consider posting your final query.