title: Query a column and result with same value of another column in MS SQL 2005
body: <p>I have a question to run a query on MS SQL 2005 Management studio, I have a table as below structure, </p>
  
  <p>|Receipt No.|    Item No.    |   Amount |</p>
  
  <pre><code>|   1     |    1    |  $10  |
  
  |   1     |    X    |  $0   |
  
  |   2     |    2    |  $10  |
  
  |   2     |    X    |  $0   |
  </code></pre>
  
  <p>How can query with any Item No. X with associated any same Receipt No and a sum of Amount? Etc.</p>
  
  <p>the result of 2 records of Receipt No. 2 and Item No. 2 and X with total amount $10 ($10+0), (actually both 4 records above should be resulted.)</p>
  
  <p>Many Thank!</p>
  
  <p>Patrick</p>