The purpose of not counting a sacrifice fly as an at-bat is to avoid penalizing hitters for a successful action.
But, while a sacrifice fly does not affect a player's batting average, it counts as a plate appearance and lowers the on-base percentage.
In 1912, Larry Gardner of the Boston Red Sox hit a fly ball off a pitch from the New York Giants' Christy Mathewson.
Steve Yerkes tagged up and scored from third base to win game 8 in the tenth inning and take the series for the Red Sox.
He got six hits, finishing with an official .406 average, the last player in over 80 years to bat .400 or more in the American or National League.