Ò׽ؽØÍ¼Èí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö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


Ïà¹ØÎÊ´ð£º

mysqlµÄÁ¬½Ó³¬Ê±Ê±¼äÔõôÉèÖà - VC/MFC / Êý¾Ý¿â

ÎÒÊÇÓÃmysql×Ô´øµÄC API
if(mysql_real_connect(&mysql,"125.0.0.108","root","root","home",3306,NULL,0))

AfxMessageBox("Êý¾Ý¿âÁ¬½Óʧ°Ü") ......

ÐèÒªÊÓÆµ½Ì³ÌµÄÐÂÊÖ½ø php + mysql + apache ÅäÖÃ

Õâ¸öÊÓÆµ½²µÄºÜÏêϸ, ¶ÔÐÂÊַdz£ÓÐÓÃ, »ù±¾ÉÏÒ»¿´¾Í¶®
ÓÉÓÚÌ«´óÁË(50m, ÎÒÖ»ÄÜÉÏ´«20m), ÎÒÉÏ´«²»ÁË, Ö»ºÃÌù³öÏÂÔØµØÖ·
ÏÂÔØµØÖ·: http://ftel1.3800hk.com/0807/080720djxnzj.rar
ºÃ¶«Î÷,ϸö¿´¿´


......

MYSQLÈçºÎÓëC++Á¬½Ó£¿ - VC/MFC / Êý¾Ý¿â

ÎÒÊÇÐÂÊÖ£¬³õѧMYSQL£¬Óкܶ಻¶®£¬Íû´Í½Ì£¡£¡
±ÈÈç˵ÎÒн¨Ò»¸öMYSQLÊý¾Ý¿âUSER Êý¾Ý¿âÖÐÓбíLIST 
È»ºóÎÒÔÚVCÖÐн¨Ò»¸öMFC¶Ô»°¿ò¹¤³Ì£¬È»ºóÎÒÔõôÑù²ÅÄÜÓÃVC»ñµÃÊý¾Ý¿âÖбíµÄÊý¾Ý£¿
Ï£Íû¸ø³ö¾ßÌåµÄ²Ù×÷² ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØÍ¼ | ¸ÓICP±¸09004571ºÅ