Here is a bit of sample sql code. You'll need to build out your additional sql needed (fields, tables, etc) and eventually convert to NSQL. But this can get you started:
select srm.id, srm.name, srm.unique_name, prt.prid subprojID, prt.prname subProject
from niku.srm_projects srm, niku.prtask prt, niku.prsubproject prsub
where srm.id = prt.prprojectid
and prt.prid = prsub.prtaskid
and srm.unique_name = 'your project code here';
Allen