title: MySQL: View with Subquery in the FROM Clause Limitation
body: <p>In MySQL 5.0 why does the following error occur when trying to create a view with a subquery in the FROM clause?</p>
  
  <blockquote>
    <p>ERROR 1349 (HY000): View's SELECT contains a subquery in the FROM clause</p>
  </blockquote>
  
  <p>If this is a limitation of the MySQL engine, then why haven't they implemented this feature yet?</p>
  
  <p>Also, what are some good workarounds for this limitation?</p>
  
  <p>Are there any workarounds that work for any subquery in the FROM clause or are there some queries that can not be expressed without using a subquery in the FROM clause?</p>
  
  <hr>
  
  <p>An example query (was buried in a comment):</p>
  
  <pre><code>SELECT temp.UserName 
  FROM (SELECT u1.name as UserName, COUNT(m1.UserFromId) as SentCount 
        FROM Message m1, User u1 
        WHERE u1.uid = m1.UserFromId 
        Group BY u1.name HAVING SentCount &gt; 3 ) as temp
  </code></pre>