title: mysql (5.1) > create table with name from a variable
body: <p>I'm trying to create a table with a name based on the current year and month(<code>2011-09</code>), but MySQL doesn't seem to like this.</p>
  
  <pre><code>SET @yyyy_mm=Year(NOW())+'-'+Month(NOW());
  CREATE TABLE `survey`.`@yyyy_mm` LIKE `survey`.`interim`;
  SHOW TABLES IN `survey`;
  
  +-----------+
  | interim   |
  +-----------+
  | @yyyy_mm  |
  +-----------+
  </code></pre>
  
  <p>If I do <code>CREATE TABLE;</code> without the ticks around <code>@yyyy_mm</code>, I get a generic syntax error.</p>
  
  <p><code>@yyyy_mm</code> resolves to <code>2020</code>.</p>