Tengo el siguiente query:
$sql='select * from "SubProblems" where id_problem="Problems".id and "Problems".id=(select id from "Problems" where name='Red');';
esto en php y me marca el siguiente error uunexpected T_STRING
 
y en postgres desde una terminal tengo lo siguiente:
select * from "SubProblems" where id_problem="Problems".id and "Problems".id=(select id from "Problems" where name='Red'); y si me arroja lo que quiero.
 
alguien me puede decir que esta mal. 
  
 
 
