title: How to parse a SQL Query statement for the names of the tables
body: <p>I have a string representing a SQL query, and I need to extract the names of the tables from that string. For example:</p>
  
  <pre><code>SELECT * FROM Customers
  </code></pre>
  
  <p>Would return "Customers". Or</p>
  
  <pre><code>SELECT * FROM Customers c, Addresses a WHERE c.CustomerName='foo'
  
  SELECT a.AddressZip FROM Customers c
  INNER JOIN Addresses a ON c.AddressId=a.AddressId
  </code></pre>
  
  <p>Would return "Customers, Addresses". Getting more advanced:</p>
  
  <pre><code>(SELECT B FROM (SELECT C FROM (SELECT Element AS C FROM MyTable)))
  </code></pre>
  
  <p>Would simply return "MyTable"</p>
  
  <p>(Note, I may have typo'd the queries but you get the idea).</p>
  
  <p>What would be the best/most accurate way of accomplishing this?</p>