In MySQL 5.0, why the following error occurs when trying to create a view with a subquery in the FROM clause?
ERROR 1349 (HY000): SELECT view contains subquery in FROM clause
If this is a limitation for the MySQL engine, then why haven't they implemented this function yet?
Also, what are some good ways to get around this limitation?
Are there any workarounds that work for any subquery in the FROM clause, or are there some queries that cannot be expressed without using the subquery in the FROM clause?
Request example (was buried in a comment):
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 > 3 ) as temp
sql mysql view mysql-error-1349
Daniel Oct. 15 '08 at 19:25 2008-10-15 19:25
source share