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