I am trying to execute a query in postgresql as:
select * from A a inner join (select * from B b INNER JOIN A a ON b.col1 = a.col1 where b.col2 = \'Some Value\')