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