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