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