In the recent years, intermediate redshift (0 to 1) galaxies have been observed in various deep fields, allowing the determination of stellar masses, star formation rates (SFR), and their distribution. One of the interesting results from these studies is the fact that the stellar mass function for star-forming galaxies is ~ constant. I will show how this fact can be coupled with ?backward? models of the evolution of our Galaxy and spiral galaxies in order to bring insights in the cosmic history of galaxies and the cosmic fate of Milky Way siblings. Another application is the comparison of these stellar masses and SFR functions with those obtained for Gamma Ray Bursts (GRB) host galaxies. I will show that this comparison allows us to characterize the variation of the GRB bias with the metallicity of the progenitor.