Provided is a compound having an AMPA receptor function enhancing action, and useful as a prophylactic or therapeutic drug for depression, schizophrenia, Alzheimer's disease, attention deficit hyperactivity disorder (ADHD) and the like. The compound represented by formula (I): wherein each symbol is as defined in the DESCRIPTION, or a salt thereof has an AMPA receptor function enhancing action, and is useful as a prophylactic or therapeutic frug for depression, schizophrenia, Alzheimer's disease or attention deficit hyperactivity disorder (ADHD) and the like.