  We investigate chemical evolution in Milky Way-like galaxies based on the
cold dark matter model in which cosmic structures form via hierarchical
merging. We introduce chemical enrichment due to type Ia supernovae (SNe Ia)
into the Mitaka semi-analytic galaxy formation model developed by Nagashima &
Yoshii. For the first time we derive distributions of stellar metallicities and
their ratios in Milky Way-like galaxies treating chemical enrichment due to SNe
Ia in a hierarchical galaxy formation model self-consistently. As a first
attempt, we assume all SNe Ia to have the same lifetime, and assume
instantaneous recycling for type II supernovae (SNe II). We find that our model
reproduces well the metal abundance ratio [O/Fe] against [Fe/H] and the {iron
metallicity distribution function} in the solar neighborhood. This means that
the so-called G-dwarf problem is resolved by the hierarchical formation of
galaxies, and a gas infall term introduced in traditional monolithic collapse
models to solve this problem is well explained by the mixture of some physical
processes such as hierarchical merging of dark halos, gas cooling, energy
feedback and injection of gas and metals into hot gas due to supernovae. Our
model predicts more oxygen-enhanced stars in bulges at [Fe/H] $\simeq 0$ than
in disks. This trend seems to be supported by recent observations while they
have still uncertainties. More data in number and accuracy will provide
independent and important constraints on galaxy formation. (abridged)
