The validity of oxygen and nitrogen abundances derived from the global emission-line spectra of galaxies via the P-method has been investigated using a collection of published spectra of individual HII regions in irregular and spiral galaxies. The conclusions of Kobulnicky, Kennicutt & Pizagno (1999) that global emission-line spectra can reliably indicate the chemical properties of galaxies has been confirmed. It has been shown that the comparison of the global spectrum of a galaxy with a collection of spectra of individual HII regions can be used to distinguish high and low metallicity objects and to estimate accurate chemical abundances in a galaxy. The oxygen and nitrogen abundances in samples of UV-selected and normal nearby galaxies have been determined. It has been found that the UV-selected galaxies occupy the same area in the N/O -- O/H diagram as individual HII regions in nearby galaxies. Finally, we show that intermediate-redshift galaxies systematically deviate from the metallicity -- luminosity trend of local galaxies.