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