title: How to select from MySQL where Table name is Variable
body: <p>I have a case where getting the table name should be from a set variable like: </p>
  
  <pre><code>SET @ID_1 = (SELECT ID FROM `slider` LIMIT 0,1);
  SET @Cat = (SELECT Category FROM `slider` LIMIT 0,1);
  select * from @Cat where ID = @ID_1
  </code></pre>
  
  <p>but doing that way MySQL outputs an error, so could someone show me how I can achieve that, because these are my baby steps in MySQL.</p>