A static statistical approach to the Bak, Tang and Wiesenfeld (BTW) sandpile model is proposed. With this approach, the exact avalanche distribution of the one-dimensional BTW sandpile is given concisely. Furthermore, we investigate the two-dimensional BTW sandpile and obtain some interesting results. First, the total particle number of the two-dimensional BTW sandpile obeys some kind of stable distribution. With the increase of the sandpile scale, the stable distribution transits from Gamma to Normal distribution. Second, when the total number of particles is fixed, the avalanche distribution is not power law. The system, however, shows a kind of "negative temperature" phenomenon when the particle number increases. Third, power law distribution of the avalanche could be viewed as the result of the superposition of a series of weighted distributions which do not yield power law.