The present invention provides compounds having an agonistic activity to the cannabinoid receptor, which is represented by the formula (I):wherein R1, R2, R3, R4, and G are defined as herein, a pharmaceutically acceptable salt or a solvate thereof, and pharmaceutical compositions, atopic dermatitis treating agents, and anti-pruritus agents, especially anti-pruritus agents for oral used and for external application, which each contains the said compound as an active ingredient.