One study found that 73% of patients with borderline personality disorder have attempted suicide, with the average patient having 3.4 attempts. The following list includes the disorders that have been shown to be the strongest predictors of suicidal ideation. These are not the only disorders that can increase risk of suicidal ideation. The disorders in which risk is increased the greatest include:
Anxiety disorders
Autism spectrum disorder
Major depressive disorder: 162 
Dysthymia
Bipolar disorder
Attention deficit hyperactivity disorder (ADHD)
Premenstrual Dysphoric Disorder (PMDD)
Post-traumatic stress disorder (PTSD) and complex post-traumatic stress disorder (C-PTSD): 278 
Personality disorders
Psychosis (detachment from reality)
Paranoia
Schizophrenia: 104 
Substance use disorders, inhalant use disorder: 538 
Body dysmorphic disorder: 245 
Nightmare disorder: 405 
Gender dysphoria: 454 
Conduct disorder: 473 
Specific learning disorder: 70

Medication side effects
Antidepressant medications are commonly used to decrease the symptoms in patients with moderate to severe clinical depression, and some studies indicate a connection between suicidal thoughts and tendencies and taking antidepressants, increasing the risk of suicidal thoughts in some patients.Some medications, such as selective serotonin re-uptake inhibitors (SSRIs), can have suicidal ideation as a side effect. Moreover, these drugs intended effects, can themselves have unintended consequence of an increased individual risk and collective rate of suicidal behavior: Among the set of persons taking the medication, a subset feel bad enough to want to attempt suicide (or to desire the perceived results of suicide) but are inhibited by depression-induced symptoms, such as lack of energy and motivation, from following through with an attempt.
Medication
Prescribing medication to treat suicidal ideation can be difficult. One reason for this is that many medications lift patients energy levels before lifting their mood. This puts them at greater risk of following through with attempting suicide. Additionally, if a person has a comorbid psychiatric disorder, it may be difficult to find a medication that addresses both the psychiatric disorder and suicidal ideation. Antidepressants may be effective. Often, SSRIs are used instead of TCAs as the latter typically have greater harm in overdose.Antidepressants have been shown to be a very effective means of treating suicidal ideation. One correlational study compared mortality rates due to suicide to the use of SSRI antidepressants in certain counties. The counties which had higher SSRI use had a significantly lower number of deaths caused by suicide. Additionally, an experimental study followed depressed patients for one year. During the first six months of that year, the patients were examined for suicidal behavior including suicidal ideation. The patients were then prescribed antidepressants for the six months following the first six observatory months. During the six months of treatment, experimenters found suicide ideation reduced from 47% of patients down to 14% of patients. Thus, it appears from current research that antidepressants have a helpful effect on the reduction of suicidal ideation. Although research is largely in favor of the use of antidepressants for the treatment of suicidal ideation, in some cases antidepressants are claimed to be the cause of suicidal ideation.