title: Mysql Temporary Table Syntax
body: <p>I have a question about the syntax for creating and accessing temporary tables.<br />Here is a 
  <a href="https://stackoverflow.com/questions/4288908/joining-the-result-of-two-queries-mysql">related question</a>.</p>
  
  <h3>My table</h3>
  
  <pre><code>CREATE TABLE IF NOT EXISTS `table1` (
    `id` int(11) NOT NULL AUTO_INCREMENT,
    `name` varchar(255) NOT NULL,
    `address` varchar(255) NOT NULL,
    PRIMARY KEY (`id`)
  ) ENGINE=MyISAM  DEFAULT CHARSET=latin1 AUTO_INCREMENT=3 ;
  
  --
  -- Dumping data for table `table1`
  --
  
  INSERT INTO `table1` (`id`, `name`, `address`) VALUES
  (1, 'andrew', '5 road'),
  (2, 'bob', '6 street');
  </code></pre>
  
  <p>I am running this query. </p>
  
  <pre><code>CREATE TEMPORARY TABLE temptable SELECT id, name, address
  FROM table1
  SELECT id, name, address
  FROM temptable
  </code></pre>
  
  <p>And tried this one</p>
  
  <pre><code>CREATE TEMPORARY TABLE temptable SELECT id, name, address
  FROM table1
  DESCRIBE temptable
  </code></pre>
  
  <p>Creating the temp table works, but then when I try to get info out of the temp table I get a message saying I need to check my sql syntax.
  thanks
  andrew</p>