急,union all 使用出错???
SELECT min(fromm5time(starttime)),max(fromm5time(endtime)), inet_btoa(tunsrc),GTPTEID,
tunsrcport,tundstport,
sum(octets/1000000)as ULthroughput,
max(octets/((endtime-starttime)/1000000000)/1000000) as "max_rate(MByte/s)",
inet_btoa(src),inet_btoa(dst)
from(
select starttime,endtime,tunsrc,GTPTEID,tunsrcport,tundstport,octets,src,dst,packets from flow_agent8_job23
union all
select starttime,endtime,tunsrc,GTPTEID,tunsrcport,tundstport,octets,src,dst,packets from flow_agent8_job24
union all
select starttime,endtime,tunsrc,GTPTEID,tunsrcport,tundstport,octets,src,dst,packets from flow_agent8_job25
union all
select starttime,endtime,tunsrc,GTPTEID,tunsrcport,tundstport,octets,src,dst,packets from flow_agent8_job26
) as c
where
starttime > tom5time('2012-07-09 00:00:01' )
and endtime < tom5time('2012-07-09 23:59:59' )
and inet_btoa(dst) like '10.247%'
and ((endtime-starttime)/1000000>100)
and (packets>100)
group by GTPTEID,dst
在几个表中按时间取数据,但是运行时遇到了错误 SQL Error (126): Incorrect key file for table '/tmp/#sql_db6_0.MYI'; try to repair it */
能帮我解决么?????,不用union all 却可以取数据
------解决方案--------------------还有多少磁盘空间?
------解决方案--------------------
临时表存放空间不足
show variables like '%tmp%';
看看此目录是否已经没有足够空间用于临时表的排序
------解决方案--------------------没有足够的表空间造成的,检查。