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