The invention addresses the problem of providing a drug with inhibitory activity against ENPP2, which is a different target from prior drugs, as a pharmaceutical product that is useful in patients with urinary retention in whom the efficacy of previous drugs was unsatisfactory. The present invention provides a compound represented by formula (I) that has ENPP2-inhibiting activity (in the formula, the definitions of the various groups are the same as described in the Specifications), a salt or solvate thereof, a prodrug thereof, and an agent for preventing, treating and/or mitigating the symptoms of urinary retention containing same as an active ingredient.本發明的課題係提供一種對與既存藥不同的標的即ENPP2具有抑制活性的藥劑,以作為對以既存藥治療會效果不足的排尿障礙患者有用的醫藥品。本發明的解決手段在於提供一種具有ENPP2抑制活性之以通式(I)表示的化合物、其鹽或其溶劑合物或其等之前藥以及包含其等作為有效成分之排尿障礙的預防、治療及/或症狀改善劑:(式中,各基團之定義表示與說明書中之記載內容相同的意義。)。