A compound represented by the formula (II) is a GPR119 agonist, and is used as an agent for treating diabetes:wherein each of R23, R24, and R25 is hydrogen, halogen, C1-8 alkyl, C1-8 alkoxy, C1-8 alkylsulfonyl, or the likeeach of Q0 and T0 is CH2 or the like, or Q0 and T0 are combined to form CH=CH or the like A0 is (CH2)p, C(O), or a bondB0 is a bond or the likeone of U0 and V0 is N, and the other is CR31 or the likeeach of X0 and Y0 is CH2CH2 or the likeZ0 is C(O)OR32 or the like andeach of R21 and R22 is hydrogen, a halogen atom, hydroxyl, C1-8 alkyl, or the like.