The present invention provides a 1-thio-D-glucitol compound of the following formula, which shows the action of inhibiting the activity of SGLT2, a pharmaceutically acceptable salt of the compound, or a hydrate of the compound or the salt; and a pharmaceutical comprising such a compound as an active ingredient, especially, a pharmaceutical for preventing or treating diabetes, diabetes-related disease, or diabetic complication. The invention also provides a method for producing the 1-thio-D-glucitol compound and its intermediate.