易截截图软件、单文件、免安装、纯绿色、仅160KB

mysql问题,跪求高手解答

select c.globalUid,c.badge,temp.sumB,temp.sumP from tb_user c,(select a.uid,sum(a.badge) as sumB,IFNULL(sum(b.propertyNum),0) as sumP,sum(a.badge)-IFNULL(sum(b.propertyNum),0) as cha from tb_buyfun_log a left join buyrecord b on a.uid=b.globaluid group by a.uid having cha>500) as temp where uptime>'2009-12-01 00:00:00' and globaluid=temp.uid


谁帮忙优化下这语句,我在电脑上运行后很慢,有时半天都不出来,有时连查询工具都搞起死掉,关也关不了, 各位高手帮忙看下好不?

SQL code:
select c.globalUid,c.badge,temp.sumB,temp.sumP
from tb_user c,(
select a.uid,sum(a.badge) as sumB,
IFNULL(sum(b.propertyNum),0) as sumP,
sum(a.badge)-IFNULL(sum(b.propertyNum),0) as cha
from tb_buyfun_log a left join buyrecord b on a.uid=b.globaluid
group by a.uid
having cha>500
) as temp
where uptime>'2009-12-01 00:00:00' and globaluid=temp.uid



你这是个笛卡积啊。

贴出你的
show index from tb_user
show index from tb_buyfun_log
show index from buyrecord
以及
explain select c.globalUid,c.badge,temp.sumB,temp.sumP
from tb_user c,(
select a.uid,sum(a.badge) as sumB,
IFNULL(sum(b.propertyNum),0) as sumP,
sum(a.badge)-IFNULL(sum(b.propertyNum),0) as cha
from tb_buyfun_log a left join buyrec


相关问答:

介绍Oracle和mysql的书 - Oracle / 非技术区

我对SQL SERVER和ACCESS比较熟,所以数据库的通用基础东西可以说都掌握的差不多了,我现在想要的就是以上两数据库的独特之处的介绍和应用介绍。
另外书最好对应最新版本 oracle是11g吧 10的也行;mysql是5.1吧
谢 ......

关于MYSQL的innodb表备份的问题

请问下哪位仁兄有比较好的备份方案,用什么工具或者用什么方式,小弟借鉴下
直接用MYSQLDUMP备份
OR
用SQLYOG之类的图形化管理工具备份

直接用mysql自带的 mysqldump 就可以了。
http://dev.mysql.com/doc/re ......

eclipse连接mysql数据库 - Java / Eclipse

先上错误
无法联接数据库
java.sql.SQLException: Before start of result set
at com.mysql.jdbc.SQLError.createSQLException(SQLError.java:910)
at com.mysql.jdbc.ResultSet.checkRowPos(ResultSet.java: ......

从mysql读图片路径但是无法显示

大家帮我看下吧,本来数据库没有东西,能显示没有东西的信息,但是我添加了一条内容后,字没了,但是图片也无法显示,红叉叉也没有,怎么回事啊?
PHP code:

<?php
$str="select * from product wh ......

mysql数据找回难题,高分,急!!!

我在清理mysql的时候,一不留神将mysql(即data里的mysql文件夹)数据库给删掉了,隔了几个小时我重启了mysql软件,mysql就自动初始化了数据库,导致从删除mysql文件夹开始到重启这段时间的数据丢失,那位高手帮想想办 ......
© 2009 ej38.com All Rights Reserved. 关于E健网联系我们 | 站点地图 | 赣ICP备09004571号