Hay un error: ERROR: column "carlos" does not exist LINE 25: WHERE n.idnota =carlos ^