我想把一条查询语句的结果保存成一个新表,如何写sql?
比如下面的select
select symbol,min(close) from quote where date<'2010-06-01' and date>'2010-01-01' group by symbol;
我这样写不行
select symbol,min(close) from quote as tt where date<'2010-06-01' and date>'2010-01-01' group by symbol;
mysql> select * from tt;
ERROR 1146 (42S02): Table ' tt' doesn't exist
比如下面的select
select symbol,min(close) from quote where date<'2010-06-01' and date>'2010-01-01' group by symbol;
我这样写不行
select symbol,min(close) from quote as tt where date<'2010-06-01' and date>'2010-01-01' group by symbol;
mysql> select * from tt;
ERROR 1146 (42S02): Table ' tt' doesn't exist
MySQL官方文档 http://dev.mysql.com/doc/refman/5.1/zh/index.html