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