The problem of the present invention is to provide a useful compound as a glucokinase activating agent, which is the oxime derivative of the formula [I]: wherein Ring A is aryl or heteroaryl; Q is cycloalkyl, heterocycle, alkyl or alkenyl; Ring T is heteroaryl or heterocycle; R1 and R2 are independently hydrogen atom, halogen atom, cycloalkylsulfonyl or the like; R3 and R4 are independently hydrogen atom, hydroxy, oxo, halogen atom or the like; R5 is hydrogen atom, halogen atom, cyano, nitro, tetrazolyl or the like; or a pharmaceutically acceptable salt thereof.