select *
from (select * from table) 'table1';
我不明白爲什麼我收到此錯誤:MySQL的語法錯誤附近 「從(子查詢) '表'」
ERROR 1064(42000):You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ''table1'' at line 2
我已經檢查了手冊(MySQL subquery in FROM clause),我看不出任何例子和我的小陳述之間的區別。
不完全正確。 OP正在這樣做,但使用單引號使別名成爲字符串,而不是別名/字段/表名稱。 – 2013-04-24 21:51:29