mysql¶à±íÁªºÏ²éѯ²¢Í³¼Æ
ÍƹãµØµã±ípromotion_addr×ֶΣºname£¬id
µç»°±¨¿¢±íunicom_record×ֶΣºdate, sheet_id£¨¹ØÁªsheet±íid£©
±¨µ¥±ísheet×ֶΣºid,promotion_addr_id£¨¹ØÁªpromotion_addr±íid£©
ÒªÇóͳ¼Æij¸öÔÂÒѱ¨¿¢¸÷ÍƹãµØµãµÄÍƹã¸öÊý£»
SELECT
p.name, count(*)
from
unicom_record AS ur
Left Join sheet AS s ON ur.sheet_id = s.id
Left Join promotion_addr AS p ON s.promotion_addr_id = p.id
WHERE
ur.status = 'COMPLETE' AND
ur.`date` >= '2010-03-01' AND
ur.`date` < '2010-04-01'
GROUP BY
p.id
(»òʹÓÃbetween andÓï¾ä)
Ïà¹ØÎĵµ£º
´æ´¢¹ý³ÌÊÇÒ»ÖÖ´æ´¢ÔÚÊý¾Ý¿âÖеijÌÐò£¨¾ÍÏñÕý¹æÓïÑÔÀïµÄ×Ó³ÌÐòÒ»Ñù£©£¬×¼È·µÄÀ´Ëµ£¬MySQLÖ§³ÖµÄ“routines£¨Àý³Ì£©”ÓÐÁ½ÖÖ£ºÒ»ÊÇÎÒÃÇ˵µÄ´æ´¢¹ý³Ì£¬ ¶þÊÇÔÚÆäËûSQLÓï¾äÖпÉÒÔ·µ»ØÖµµÄº¯Êý£¨Ê¹ÓÃÆðÀ´ºÍMysqlԤװÔصĺ¯ÊýÒ ......
# MySQL Server Instance Configuration File
# ----------------------------------------------------------------------
# Generated by the MySQL Server Instance Configuration Wizard
#
#
# Installation Instructions
# ----------------------------------------------------------------------
#
# On Li ......
ÄãʹÓùý±ðÈ˵ı¸·Ý·½°¸À´±¸·ÝÄãµÄMySQLÊý¾ÝÂð?ÄãÓжà¹ØÐÄÄãµÄÊý¾Ý?Äã¸ÒÈ·¶¨ÄãÏÖÔÚÕýÔÚÔËÐеĽű¾¾ÍÊÇ¿É¿¿µÄ£¬¿É»Ö¸´µÄ±¸·Ý£¬¶øÇÒÔÚÔËÐйý³ÌÖв»»áÓ°ÏìÄãµÄ¹Ø¼ü×÷ÒµÂð?ÔڻشðÕâ¸öÎÊÌâ֮ǰ£¬ÏȻشðÏÂÃæÊ®¸öÎÊÌâ°É£º
¡¡¡¡1. ±¸·ÝÒªÇóÍ£Ö¹Êý¾Ý¿âÂð?Èç¹û²»ÐèÒª£¬ÄÇô±¸·ÝµÄʱºò»áÓ°Ïìʲô?¿éÉ豸?I/O¸ºÔØ?»º³å?»òÕßÊÇÆäËû?
¡¡ ......
1.ʵÏÖTAB¼ü²¹È«
SHELL>vi /etc/my.cnf
[mysql]
#no-auto-rehash
auto-rehash
SHELL>reboot mysqld
note: 1.ÒªÏÈuseµ½Ä³¸öÊý¾Ý¿âÏ£»2.Òª²¹È«µÄ¹Ø¼ü×ÖÐèÒª´óд¡£
2.promptÈòÙ×÷¸ü¼ÓÇå³þ
mysql>prompt \u@\h(\d) \r:\m:\s (ÁÙʱ)
[mysql] £¨³¤¾Ã£©
prompt=\\u@\\h
3.pagerÈÃä ......
Win2003server ϼÜÉèPHPWind²úÆ·»·¾³
°²×°Ç°×¼±¸:1¡¢°²×°ºÃiis6
&nbs ......