select cc.* from contents cc
join items ii on ii.contentid=cc.contentid 
where ii.itemid in (select itemid from parts where fromtype=5)