I've got into a really bad/good habit (depending on your perspective) of having a number 1 just before getting in the plane (after having done the pre-flight checks), and then going again pretty much as soon as I get out after landing.
The funny thing is I never seem to need to go during the flight regardless of how long it is.
I always have a bottle of water to hand during a flight as well, and am careful to have a sip regularly.