title: SQLite Update same table with Select
body: <p>I am trying to update a table based on the values in the table already.</p>
  
  <p>Player Fixture</p>
  
  <pre><code>PlayerFId
  FixtureFId
  Availability
  SelectedPosition
  </code></pre>
  
  <p>I want to update all rows where the player id is the same and take the values from a previous fixture id.</p>
  
  <p>Example data    </p>
  
  <pre><code>PlayerFId Fixture FId Availability SelectedPosition
      1           1          N              2
      1           2          U              0
      2           1          A              3
      2           2          U              0
  </code></pre>
  
  <p>I want to update all the rows for FixtureFId 2 with the relevant PlayerFId data for FixtureId 1.</p>
  
  <p>End Result</p>
  
  <pre><code>PlayerFId Fixture FId Availability SelectedPosition
          1           1          N              2
          1           2          N              2
          2           1          A              3
          2           2          N              3    
  </code></pre>
  
  <p>I have tried using this SQL but it doesn't map the PlayerFId values correctly</p>
  
  <pre><code>UPDATE player_fixture 
  SET 
      Availability = (SELECT Availability FROM player_fixture WHERE FixtureFId = 1), 
      SelectedPosition = (SELECT SelectedPosition FROM player_fixture WHERE FixtureFId = 1) 
  WHERE FixtureFId = 2
  </code></pre>