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