Diabetic patients may have poorer sexual function than normal. At least half of diabetic patients have varying degrees of sexual dysfunction, especially erectile dysfunction. Diabetes may affect the blood vessels and nerves related to erection, which may lead to the development of impotence. Patients with diabetes do not experience a decline in sexual function at the same time. Some patients have been diabetic for a long time and still have normal sexual function, while some patients have just discovered diabetes for 1-2 years and can experience a dramatic decline in sexual function. In addition, some diabetic patients can experience non-ejaculation and retrograde ejaculation, which may also be related to diabetes damaging the nerves that innervate the contraction of the seminal vesicles, resulting in the vesicles not contracting properly, thus affecting normal ejaculation. Diabetes is a risk factor that threatens sexual function, so middle-aged and elderly diabetic patients with hypogonadism should be treated by first controlling risk factors such as blood pressure, blood glucose and blood lipids. At the same time, drugs for erection, such as sildenafil and tadalafil class of PDE5 inhibitors, can be used to improve penile blood flow and increase erection hardness and duration, thus improving sexual function.