title: SQL Query - Finding Value of item from all database
body: <p>I have this Table :</p>
  
  <pre><code>Trans_ID    Name    Fuzzy_Value    Total_Item  
  100          I1  0.33333333        3  
  100          I2  0.33333333        3  
  100          I5  0.33333333        3  
  200          I2  0.5               2  
  200          I5  0.5               2  
  300          I2  0.5               2  
  300          I3  0.5               2  
  400          I1  0.33333333        3  
  400          I2  0.33333333        3  
  400          I4  0.33333333        3  
  500          I1  0.5               2  
  500          I3  0.5               2  
  600          I2  0.5               2  
  600          I3  0.5               2  
  700          I1  0.5               2  
  700          I3  0.5               2  
  800          I1  0.25              4  
  800          I2  0.25              4  
  800          I3  0.25              4  
  800          I5  0.25              4  
  900          I1  0.33333333        3  
  900          I2  0.33333333        3  
  900          I3  0.33333333        3  
  1000         I1  0.2               5  
  1000         I2  0.2               5  
  1000         I4  0.2               5  
  1000         I6  0.2               5  
  1000         I8  0.2               5  
  </code></pre>
  
  <p>I need to scan all database for each unique item then count sum of each fuzzy value for that item divided by total transaction (which is 10 in this table)</p>
  
  <p>Example : </p>
  
  <pre><code>I1 = Sum of (Fuzzy_Value from item I1 in trans 100 until 1000) 
      -&gt; (0.33333333+0.33333333+0.5+0.5+0.25+0.33333333+0.2)/10 = 0.244999999
  </code></pre>
  
  <p>as you can see I1 exist in transaction <code>100,400,500,700,800,900,1000</code> ;<br>
  with value of <code>0.33333333+0.33333333+0.5+0.5+0.25+0.33333333+0.2</code>
  divide by total transaction, we get the number needed.</p>
  
  <pre><code>ITEM_SET           Support  
  {I1}               0.244999999
  {I2}               0.274999999     
  {I3}               0.258333333    
  {I4}               0.103333333  
  </code></pre>
  
  <p>How do i do that?</p>