title: SQL: partition over two columns
body: <p>I have following table:</p>
  
  <pre><code>---------------------
  | No1 | No2  | Amount
  ---------------------
  | A   |  B   |    10 |
  | C   |  D   |    20 |
  | B   |  A   |    30 |
  | D   |  C   |    40 |
  ---------------------
  </code></pre>
  
  <p>and I want to sum over partition by both columns (No1,No2) but it should group also when the values are changed in the two columns. Example would be: AB = BA </p>
  
  <p>This would be my expected result:</p>
  
  <pre><code>-----------------------------------------
  | No1 | No2  | Sum(Amount) over partition
  -----------------------------------------
  | A   |  B   |    40                    |
  | C   |  D   |    60                    |
  | B   |  A   |    40                    |
  | D   |  C   |    60                    |
  -----------------------------------------
  </code></pre>
  
  <p>Any ideas?</p>