join nested queries in from clause
<p>Can you tell me what I need to manipulate in this query to get it working?</p>

<pre><code>select C.ID from 
(select A.ID from CUSTOMERS A inner join PROFILES B on A.ID=B.ID where CTR='67564' and CST_CD in 
('G','H')) as C 
inner join
(select ID from RELATION_CODES where R_CD='KC') as R
on C.ID=R.ID
</code></pre>

<p>The individual inner queries are working just fine and giving correct results, not sure what is the problem with <code>inner join</code> in from clause..</p>