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