title: Access Query subtract 2 different column from different row in same table with same ID
body: <p><a href="https://i.stack.imgur.com/Gfspa.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Gfspa.jpg" alt="enter image description here"></a></p>
  
  <p>I have a table <code>deposit</code> which have column <code>Refund_amt</code> ,<code>Deposit_amt</code> having different Rows with same <code>GR_no</code> . here my question is ,I want to subtract <code>deposit_amt</code> column from <code>Refund_amt</code> 
  I tried various alternative in query but didn't succeed </p>
  
  <p><strong>My query :</strong> </p>
  
  <pre><code>SELECT d.Gr_no
       , d.Rec_No
       , d.Deposite_Amt
       , d.penalty_Amt
       , d.Refund_Amt - Refund 
       , s.Name
       , s.cur_std
       , cur_div 
    From  
       ( select d.Refund_Amt refund 
           from deposite d 
              , std_gr s  
          where d.Gr_no = s.Gr_no   )
  </code></pre>
  
  <p><strong>Result would look like this in <code>final total</code> column :</strong></p>
  
  <p><a href="https://i.stack.imgur.com/rWWWo.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/rWWWo.jpg" alt="enter image description here"></a></p>
  
  <p>Thank you </p>