title: sqlalchemy.exc.MultipleResultsFound: Multiple rows were found when exactly one was required
body: <p>I have such structure in database</p>
  <pre><code>tasks_exams = db.Table('tasks_exams',
      db.Column('task_id', db.Integer, db.ForeignKey('tasks.id')),
      db.Column('exam_id',  db.Integer, db.ForeignKey('exams.id'))
  )
  
  class Tasks(db.Model):
      __tablename__ = 'tasks'
  
      id        = db.Column(db.Integer, primary_key=True, autoincrement=True)
      task      = db.Column(db.Text)
  
  
  class Exams(db.Model):
      __tablename__ = 'exams'
  
      id = db.Column(db.Integer, primary_key=True, autoincrement=True)
      name_of_Exam = db.Column(db.String(140))
      number_of_exam_task = db.Column(db.SmallInteger)
      name_of_exams_task = db.Column(db.String(140))
  
      tasks = db.relationship('Tasks',
                              secondary=tasks_exams,
                              back_populates=&quot;exams&quot;)
  </code></pre>
  <p>I want to get all Tasks where exams_1 is:</p>
  <pre><code>tasku = Exams.query.filter(Exams.name_of_Exam == &quot;exams_1&quot;).scalar()
  </code></pre>
  <p>And I get an error:</p>
  <pre><code>sqlalchemy.exc.MultipleResultsFound: Multiple rows were found when exactly one was required
  </code></pre>
  <p>How should I solve my problem?</p>