Bernoulli’s equation states that the,
P + 1/2ρV2 + ρgh = c
P is the pressure, r is the density, v is the velocity, h is the elevation difference.
The value of C in the above equation is constant only along a streamline and should essentially vary from streamline to streamline.
The equation can be used to define the relation between flow variables at point B on the streamline and at point A, along the same streamline. So, to apply this equation, one should have knowledge of the velocity field beforehand. This is one of the limitations of the application of Bernoulli's equation.
Therefore, the total mechanical energy remains constant everywhere in inviscid and irrotational flow, while it is constant only along a streamline for inviscid but rotational flow.