Like dogs, cats & parrots goldfish have very sharp memory. They can even remember things for a few months also. There is a myth : 3 second goldfish memory. Actually it's a bogus. Scientist have already proved that goldfish have a very long memory. Here is the experiment researchers of Technion Institute of Technology in Israel did -
First they trained baby goldfish to associate a sound played through a loudspeaker with feeding time. Every time when researchers played a particular sound, the baby goldfish would return for food.
After one month of training, researchers released the baby goldfish into the sea from a cage. Five months later they had become adults. Then scientists played that specific sound and all adult goldfish returned to their cage.
References:
http://todayilearned.co.uk/2013/07/05/goldfish-actually-have-relatively-long-memory-and-can-remember-things-for-months/