Let $X$ be a scheme, $U\subseteq X$ open affine and $Y$ a closed subscheme of $X$. Is it true that $Y\cap U$ is an open affine subscheme of $Y$?
To be more precise, we have an open immersion $U\to X$ and a closed imersion $Y\to X$, so we can form the fiber product $U\times _X Y$ which we call $U\cap Y$ and the induced morphism $U\cap Y\to Y$ is an open immersion as well. Now, with the assumption that $U$ is an affine scheme, we can ask if $U\cap Y$ is an affine scheme. The question is, is it always the case? is it with some additional assumptions? is there a simple provable counterexample?