单独可以用的啊 视图应该可以用 贴你的各个explain
解决方案 »
- 无法使用arcCatalog中的右键--- import-- Feature Class single
- MySQL:用IF语句判断该插入哪个值怎么写?
- 求个两列条件要求最少的sql语句或程序算法
- 来交学费的
- 用mysql时 .frm文件复制后.......
- 求mysql-max-5.0.18-linux-i686-glibc23.tar.gz,万分感谢!!急用!!!!
- 请问如何通过主索引批量读取数据?
- 数据库MySQL提问如何把表中元素的default null修改成not null?或者not null修改成default null
- 关于SQL统计
- 关于VB.NET与MYSQL
- 一个left join 的问题(结果翻倍)
- 帮忙看一下这个查询,分组查询出现sending data
id select_type table type possible_keys key key_len ref rows Extra
1 PRIMARY <derived2> ALL \N \N \N \N 77561 Using where
2 DERIVED a ALL \N \N \N \N 40329
3 UNION c ALL \N \N \N \N 36832
\N UNION RESULT <union2,3> ALL \N \N \N \N \N
视图分2种
1:create view v1 as select id,name from a union all select id,name from b;这样没有对原表有统计信息的,视图是原表数据的,那么就可以用到原表的索引2:create view v2 as select id,sum(grade) as grade from a union ...
用到了统计函数的,就不能用到原表的索引。
视图语句是
create view v1 as select id,name from a union all select id,name from b;
把2个表中我想要的数据 存到一个视图里面查询语句是
select * from v1 where id=?这样查询 既不会查询a表的索引。也不会用b表的索引