The invention discloses a method for preparing a corresponding pyridine compound from a 1,4-dihydropyridine compound. The method comprises the following steps: adding a 1,4-dihydropyridine compound, tetra-n-butyl ammonium salt of eosin Y and potassium carbonate into an organic solvent-water mixed solvent, evenly mixing, and introducing air to react under the irradiation of visible light; and after the reaction finishes, adding ethyl acetate, washing respectively with water and saturated ammonium chloride, removing the inorganic alkali, regulating the system to a slightly acidic state, adding a small amount of activated carbon into the organic phase to remove the pigment, drying with anhydrous sodium sulfate, carrying out centrifugal drying, and recrystallizing to obtain the corresponding pyridine compound. Compared with the prior art, the method disclosed by the method uses oxygen in air, which is cheap, convenient and accessible, as the oxidizer. By using sunlight as the energy, the method is more beneficial to industrial production. By using the catalytic amount of non-metal photocatalyst, the method lowers the synthesis cost and prevents the noble metals from accumulation in drug synthesis.