  Exploiting the capabilities of four different surveys --- the
Padova-Millennium Galaxy and Group Catalogue (PM2GC), the WIde-field Nearby
Galaxy-cluster Survey (WINGS), the IMACS Cluster Building Survey (ICBS) and the
ESO Distant Cluster Survey (EDisCS) --- we analyze the galaxy stellar mass
distribution as a function of local density in mass-limited samples, in the
field and in clusters from low (z>0.04) to high (z<0.8) redshift. We find that
at all redshifts and in all environments, local density plays a role in shaping
the mass distribution. In the field, it regulates the shape of the mass
function at any mass above the mass limits. In clusters, it seems to be
important only at low masses (log M_ast/M_sun <10.1 in WINGS and log
M_ast/M_sun < 10.4 in EDisCS), otherwise it seems not to influence the mass
distribution. Putting together our results with those of Calvi et al. and
Vulcani et al. for the global environment, we argue that at least at $z\leq
0.8$ local density is more important than global environment in determining the
galaxy stellar mass distribution, suggesting that galaxy properties are not
much dependent of halo mass, but do depend on local scale processes.
