This was due to a mistranslation. The "second" Goliath was in fact a brother of the first. (See 1 Chronicles 20 v 5).
So Elhanan slew Goliath's brother. David slew Goliath.
Further reading shows that when Elhanan slew Goliath's brother, it was at a time when David was already King, therefore it was two separate occasions.
Where Is Greta Thunberg These Days?


