select md.code,v.code from cfvariable as v
inner join cfvarmdl as mv on v.idvarmdl=mv.idvarmdl
inner join cfdevmdl as md on mv.iddevmdl=md.iddevmdl and md.code='YH17'
where v.code ~ '^Temp\d$'
select md.code,v.code from cfvariable as v
inner join cfvarmdl as mv on v.idvarmdl=mv.idvarmdl
inner join cfdevmdl as md on mv.iddevmdl=md.iddevmdl and md.code='YH17'
where v.code ~ '^Temp\d$'