title: Sql query to find subtotal of distinct column and grand total from a single table?
body: <p>I have a table in which I have 3 columns</p>
  
  
  
  <pre><code>ID  Amount  District
  1   100     A
  2   500     B
  1   250     A
  2   240     B
  1   100     A
  </code></pre>
  
  <p>Now I want to display Subtotal of distinct district and Grand total. Please guide me how should I write my sql query.</p>
  
  <p>I want to show output as-</p>
  
  <pre><code>District  Subtotal  Grand Total
  A          450
  B          740        1190
  </code></pre>