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