Ò׽ؽØͼÈí¼þ¡¢µ¥Îļþ¡¢Ãâ°²×°¡¢´¿ÂÌÉ«¡¢½ö160KB

mysql Óï¾äÓÅ»¯²éѯ

ÎÒÓõÄÊÇmysql5.0£¬
ÎÒ³ÌÐòÖÐÓõ½ÁËÒ»¾äsqlÊÇ
SQL code
select count(DISTINCT id) from Policyinfo p where p.filename not in
(select p2.filename from Policyreadinfo p2 where p2.reader='test')
µ«ÊÇÿ´ÎÔÚ³ÌÐòÖÐÿ´ÎÖ´ÐÐÕâ¾äsqlʱÍøÒ³¾ÍÌØÂý£¬Òª10¶àÃ룬¶øÕâ2¸ö±íµÄ¼Ç¼ÐÐÊýÒ²¾Í1000¶à¶øÒÑ£¬ÎÒ°ÑÕâ¾äsqlµ¥¶ÀÄõ½SQLyog EnterpriseÀïÖ´ÐÐÒ²ºÜÂý£¬ºÍÍøÒ³µÄÖ´ÐÐʱ¼ä²î²»¶à¡£ÎÒÏëÔÚpolicyreadinfo±íÀィ¸öË÷Òý£¬µ«ÊÇÿ´ÎÎÒÖ´Ðн¨Á¢Ë÷ÒýµÄsqlʱ£¬MYSQL¾Í»áÍ£µô£¬½¨²»ÁËË÷Òý¡£
ÎÒÓõĵ½µÄ½á¹ûÈçÏ£º
"id", "select_type", "table","type","possible_keys","key","key_len","ref","rows","Extra"
"1", "PRIMARY", "p", "ALL", \N, \N, \N, \N, "1715","Using where"
"2", "DEPENDENT SUBQUERY","p2", "ALL", \N, \N, \N, \N, "4196","Using where"
ÆäÖбíPolicyinfo½á¹¹Îª
SQL code
CREATE TABLE `policyinfo` (
`id` int(11) NOT NULL auto_increment,
`filenum` varchar(50) default NULL,
`filename` varchar(100) default NULL,
`filecontent` longtext,
`writetime` datetime default NULL,
`writer` varchar(100) default NULL
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
Policyreadinfo ±íµÄ½á¹¹ÊÇ
SQL code
CREATE TABLE `policyreadinfo` (
`id` int(11) NOT NULL auto_increment,
`filename` varchar(500) default NULL,
`reader` varchar(100) default NULL,
`readtime` datetime default NULL,
PRIMARY KEY (`id`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8;
ÕâÊÇÎÒÔÚÂÛ̳ÉÏÌá³öµÄÎÊÌâ¡£Ô´ÎÄÁ´½Ó£ºhttp://topic.csdn.net/u/20100325/10/801d54f6-121b-4431-873d-e061dc60c6a6.html
ºóÀ´¾­¹ýÎҵIJâÊÔ£¬ÖÕÓÚÔçµ½½â¾ö°ì·¨À²¡£ÔÚ2¸ö±ífilenameÉÏ·Ö±ð½¨Á¢Ë÷Òý¡£Ö®Ç°Ò²ÓÐÏë¹ýÕâ¸ö°ì·¨£¬µ«ÊDz»ÖªµÀΪʲôһִÐн¨Á¢Ë÷ÒýµÄSQL£¬MYSQL¾Í»áËÀµô¡£ËùÒÔºóÀ´¾ÍûÓг¢ÊÔÕâÖÖ·½·¨À²¡£
ºóÀ´ÔÚ±¾»ú²âÊÔ·¢ÏÖ½¨Á¢Ë÷ÒýºóµÄ²éѯËÙ¶ÈÊǽ¨Á¢Ç°µÄN±¶¡£
ÓÚÊǾÍÐÞ¸ÄpolicyreadinfoÔÚËûÕâÀï¼ÓÒ»¸öpolicyinfo_id µÄ×ֶα£´æpolicyinfoµÄid×ֶΡ£È»ºóÔÙÔÚpolicyinfo_idÉϽ¨Á¢Ë÷Òý¡£ÎÊÌâÖÕÓÚ½â¾öÁË¡£ºÇºÇ
×ܵÄÓÅ»¯SQLÓï¾äÊÇ
-- Ôö¼ÓId ×Ö¶Î
ALTER TABLE policyreadinfo ADD `policyinfo_id` int(11);
-- ¸üÐÂpolicyreadinfo ±í£¬ÓÐЩ×Ö¶ÎΪnullÊÇÒòΪËû°ÑÕþ²ßÃû×Ö¸ÄÁË
update policy


Ïà¹ØÎĵµ£º

Windows Ï Apache Mysql PHP °²×°ºóµÄÅäÖÃ

1 Apache
Ð޸Ġ  documentroot   ¸ùĿ¼
         directory           ·ÃÎʸùĿ¼ȨÏÞ
         directoryindex   Ä¬ÈÏÊ×Ò³ ......

(תÔØ)MySQLÖÐUNIONºÍUNION ALLµÄÇø±ð


ÔÚÊý¾Ý¿â
ÖУ¬UNION
ºÍUNION
ALL
¹Ø¼ü×Ö¶¼Êǽ«Á½¸ö½á¹û¼¯ºÏ²¢ÎªÒ»¸ö£¬µ«ÕâÁ½Õß´ÓʹÓúÍЧ
ÂÊÉÏÀ´Ëµ¶¼ÓÐËù²»Í¬¡£
MySQL
ÖÐ
µÄUNION
UNIONÔÚ½øÐбíÁ´½Óºó»áɸѡµôÖظ´µÄ¼Ç¼£¬ËùÒÔÔÚ±íÁ´½Óºó»á¶ÔËù²úÉúµÄ½á¹û¼¯½øÐÐÅÅÐòÔËË㣬ɾ³ýÖظ´µÄ¼Ç¼ÔÙ
·µ»Ø½á¹û¡£Êµ¼Ê´ó²¿·ÖÓ¦ÓÃÖÐÊDz»»á²úÉúÖظ´µÄ¼Ç¼£¬×î³£¼ûµÄÊǹý³Ì± ......

MySQL Ãâ°²×°°æÅäÖÃ

1.ÏÂÔØ MySQL 6.0Ãâ°²×°°æ
http://www.mysql.com/downloads/mirror.php?id=386828
2.½« MySQL6.0 ½âѹµ½´ý°²×°Ä¿Â¼(×Ô¼º¾ö¶¨·Åµ½ÄÄ£©¡£½âѹºóĬÈÏÎļþ¼ÐÃû³ÆΪ£ºmysql£¨µ±È»¿ÉÒÔ×Ô¼º¸ü¸Ä£©£¬È»ºóÔÚ»·¾³±äÁ¿ÖÐÉèÖÃMYSQL_HOME£¨ÕâÑù£¬ÒÔºó¿ÉÒÔÓÃ%MYSQL_HOME%ÒýÓð²×°Ä¿Â¼£©¡£È磬ÎÒ·ÅÔÚEÅ̸ùĿ¼Ï£¬ËùÒÔ£¬MYSQL_HOMEÉèÖÃΪ ......

ÐÞ¸ÄMYSQLµÄinnodb_log_file_sizeµ¼ÖµÄMYSQL±ÀÀ£


ÕâÁ½ÌìÕýÔÚ²âMYSQLµÄÐÔÄÜ£¬°´ÕÕMYSQLÎĵµÖÐÍƼöµÄÉèÖã¬ÐÞ¸ÄÁ˼¸¸öϵͳ±äÁ¿
innodb_buffer_pool_size=1G
innodb_log_file_size=250M
innodb_log_buffer_size=8M
½á¹ûMYSQL±ÀÁË¡£mysql¿Í»§¶ËÄܵǼ£¬µ«Ö»ÒªÖ´ÐÐÈκÎÃüÁmysqldÁ¢¿Ì±Àµô¡£
¿ªÊ¼»¹ÒÔΪÊÇinnodb_buffer_pool_sizeµÈ¼¸¸ö²ÎÊýÉèµÃÌ«´óÁË£¬¿ÉÊǵ÷ÕûÁ˼¸´Î¶ ......

ʹÓÃMySQL Administrator ʵÏÖMySql Êý¾Ý¿â±¸·ÝÓë»Ö¸´


MySQL Administrator ÊÇʲôÈí¼þ£¿
MySQL Administrator ÊÇÒ»¸öרÃÅÓÃÓÚ¹ÜÀí My SQL 4.X ºÍ 5.X My SQLÊý¾Ý¿âµÄÈí¼þ£¬¿ÉÒÔʹÓÃÕâ¸öÈí¼þ±¸·ÝMy SQLÊý¾Ý¿â£¬»¹Ô­My SQLÊý¾Ý¿â¡£
×¢£ºÈç¹ûÄãµÄÊý¾Ý¿âÊÇ MS SQL 2000 Êý¾Ý¿â£¬Çë²Î¿¼ÕâÀʹÓà MS SQL 2000 ÆóÒµ¹ÜÀíÆ÷¹ÜÀí
ÏÂÔØ MySQL Administrator Èí¼þ
http://61.139.76 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ