title: Compare 2 tables and update final table with the row which has max value Bigquery
body: <p>I have two tables <strong>TableA</strong> and <strong>Final_Table</strong></p>
  
  <p>TableA </p>
  
  <pre><code>ID  Step1   Step2   Step3 Step4
  1    1       1       0     0   --Update Final_table for Id1 with these values as more steps have 1
  2    1       1       1     0
  3    1       1       1     1   --Since 3 doesn't exist in Final table insert row in final table 
  </code></pre>
  
  <p>Final_Table</p>
  
  <pre><code>   ID  Step1   Step2   Step3 Step4
     1    1       0       0     0
     2    1       1       1     1 --Keep this as more steps have 1 in it
     4    0       0       0     0 --since Id4 doesn't exist in Table  
  </code></pre>
  
  <p>After Running the Query I want the final_table to look like below</p>
  
  <p>Final_Table</p>
  
  <pre><code>   ID  Step1   Step2   Step3 Step4
     1    1       1       0     0
     2    1       1       1     1
     3    1       1       1     1
     4    0       0       0     0
  </code></pre>
  
  <p>Whenever a Id exists in both table I want to Update the Final_Table with data which has max steps as 1. I would appreciate any help!Thanks in advance</p>