Ocarina of Time:
In the future, you are taught the Song of Storms that you supposedly played in the past, even though you've never learned/played it yet.
The first time you go to open Jabu-Jabu's mouth, you need a fish. If you leave and return, however, you don't need a fish to get sucked back in.