title: mysql user variable within an IN where statement
body: <p>I now gave up and sorted it by other means but because "curiosity killed the cat" I am trying to figure out how to use mysql query @variables within an IN where statement:</p>
  
  <p>So, from this:</p>
  
  <pre><code>SELECT * FROM table1 WHERE table1.ID IN (794,758)
  </code></pre>
  
  <p>Try to include a variable and this returns a syntax error:</p>
  
  <pre><code>SET @variousids="(794,758)";
  SELECT * FROM table1 WHERE table1.ID IN @variousids
  </code></pre>
  
  <p>This returns values only from the first:</p>
  
  <pre><code>SET @variousids="794,758";
  SELECT * FROM table1 WHERE table1.ID IN (@variousids)
  </code></pre>
  
  <p>I've tried different syntax, values and have not found any specific doc about defining list of values.</p>