The present invention provides nitrogen-containing fusedcyclic derivatives represented by the following general formulaor pharmaceutically acceptable salts thereof, or prodrugsthereof, which exhibit an excellent inhibitory activity in humanSGLT and are useful as agents for the prevention or treatmentof a disease associated with hyperglycemia such as diabetes,postprandial hyperglycemia, impaired glucose tolerance,diabetic complications or obesity, in the formula one of R1 andR4 represents a group represented by the following generalformula (S) (in which R5 and R6 represent H, OH, a halogen atom,etc. ; Q represents an alkylene group etc. ; and ring A representsan aryl group etc.), and the other represents H, OH, an aminogroup, etc.; R2 and R3 represent H, OH, an amino group, a halogenatom, and an optionally substituted alkyl group, etc.; A1represents O, S, etc.; A2 represents CH or N; G represents agroup represented by the following general formula (G-1) or (G-2)(E1 represents H, F or OH; and E 2 represents H, F, a methyl group,etc.), and pharmaceutical compositions comprising the same, andpharmaceutical uses thereof.(see formula I)