Experience is the solution of being greedy in gambling, it is the way we control our emotions. With experience we can handle those emotions that bring to losing. Because of this you can win also, and if we lose it not too much.
Yes experience and time is the best teacher. It teaches you how to react to a certain situation. The greed is basically a state in which you dont realize that you are doing something bad to the society or to yourself. The power of controlling it comes with the passage of time, it is not something that we can learn for the text books but yes we can only figure out the situations and shall try to act accordingly to suffer less.