title: MySQL - Using the result of a Stored Procedure in an Inner Join
body: <p>I have a MySQL Stored Procedure that returns multiple rows. Is there a way to use this result in an Inner Join with another table? I've tried:</p>
  
  <pre><code>SELECT ErrorMessage FROM ErrorMessage em 
  INNER JOIN User_Language(pCompanyID, pUserID) l ON em.Language=l.LanguageID 
  WHERE ErrorCode = pErrorCode 
  ORDER BY l.LanguageOrder LIMIT 1;
  </code></pre>
  
  <p>In this example, User_Language is the stored procedure that returns a list of languages in order of preference. The intent is to return an error message in the user's preferred language.</p>