title: SUM function is not working in MYSQL store procedure?
body: <p>Whenever run the store  procedure its return the same output 106.
  It's sum of all data of number1 column. 
  Below the my sample code.
  I hope it will help you.
  Please correct me if i have any error.</p>
  
  <p><strong>Store Procedure :</strong></p>
  
  <pre><code>DELIMITER $$
  CREATE PROCEDURE raw_data(IN user_id INT(10),IN p_id INT(10))
  BEGIN
      SELECT SUM(number1) AS result FROM raw_data WHERE user_id=user_id AND p_id=p_id; 
  END $$
  DELIMITER ;
  </code></pre>
  
  <p><strong>Table Format :</strong> </p>
  
  <pre><code>       id name    number1     number2       user_id    p_id
          1   a       10          20              1       49
          2   b       12          12              1       49
          3   c       20          30              2       48
          4   d       22          22              2       48
          5   c       20          30              2       48
          6   d       22          22              2       49
  </code></pre>
  
  <p><strong>Input :</strong> </p>
  
  <pre><code>CALL raw_data(1, 49);   
  </code></pre>
  
  <p><strong>Output :</strong> </p>
  
  <pre><code>result
  106
  </code></pre>
  
  <p>Note : Output(106) is same if any input is given.
  Sorry for my bad english.</p>