Let $(\Omega, \mathcal F, P)$ be a probability space, and let $\mathcal G \subseteq \mathcal F$ be a sub-$\sigma$-algebra of $\mathcal F$ and $X : \Omega \to \mathbb R$ a random variable. Then the conditional expection of $X$ conditioned on $\mathcal G$ is defined to be the a.e. unique random variable $Y$ such that

(i) $Y$ is $\mathcal G$-measurable, and

(ii) for each $A \in \mathcal G$ we have $$ E[X\cdot 1_A] = E[Y\cdot 1_A]. $$ And it is denoted as $Y := E[X | \mathcal G]$. For a random variable $Z$ the conditional expection conditioned on $Z$ is defined as $E[X | Z] := E[X | \sigma(Z)]$.

These two notions are equivalent, so now my question. Given a condtional expectation $E[X | \mathcal G]$ w.r.t. some sub-$\sigma$-algebra $\mathcal G$, how to find a random variable $Z$ such that $$ E[X | Z] = E[X | \mathcal G] \quad \mbox{a.e.}? $$