title: Join table with conditional statement
body: <p>I Have mysql table like this :</p>
  
  <p><img src="https://i.stack.imgur.com/XGtVK.jpg" alt="enter image description here"></p>
  
  <p>and the result is :</p>
  
  <p><img src="https://i.stack.imgur.com/dADGz.jpg" alt="enter image description here"></p>
  
  <p>coloumn total = nilai1+nilai2
  coloumn saran = 
  - iF total >= ((max(total)-min(total))+min(total) then mayor, minor from table 1.
  - else butuh from table 2.
  But, max (total) and min(total) just count for the same Bidang.</p>
  
  <p>How to show coloumn saran in result?</p>