title: How to select some columns of a stored procedure in Mysql
body: <p>I have a stored procedure like this:</p>
  
  <pre><code>CREATE PROCEDURE `RankAll`()
  LANGUAGE SQL
  NOT DETERMINISTIC
  READS SQL DATA
  SQL SECURITY INVOKER
  COMMENT ''
  BEGIN
      select userID,sum(score) as score,@rank := @rank + 1 AS rank  from
      (
          select userID,score from ScoreMessages  
          union all   
          select userID,score from ScoreExams
      ) as scores
      JOIN (SELECT @rank := 0) rank
      group by userID
      order by score desc;
  END
  </code></pre>
  
  <p>Actually I wanted to use it as a view but I have variables because I wanted to rank them and it did not let me to use it in a view.</p>
  
  <p>I tried the query below but it is not correct:</p>
  
  <pre><code>select * from (Call `RankAll`())
  </code></pre>
  
  <p>So how can I select multiple columns out of it?</p>