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

MySQL²»Ö§³ÖINTERSECTºÍMINUS£¬¼°ÆäÌæ´ú·½·¨

Doing INTERSECT and MINUS in MySQL
By Carsten | October 3, 2005
Doing an INTERSECT
An INTERSECT is simply an inner join where we compare the tuples of one table with those of the other, and select those that appear in both while weeding out duplicates. So
SELECT member_id, name from a
INTERSECT
SELECT member_id, name from b
can simply be rewritten to
SELECT a.member_id, a.name
from a INNER JOIN b
USING (member_id, name)
Performing a MINUS
To transform the statement
SELECT member_id, name from a
MINUS
SELECT member_id, name from b
into something that MySQL can process, we can utilize subqueries (available from MySQL 4.1 onward). The easy-to-understand transformation is:
SELECT DISTINCT member_id, name
from a
WHERE (member_id, name) NOT IN
(SELECT member_id, name from table2);
Of course, to any long-time MySQL user, this is immediately obvious as the classical use-left-join-to-find-what-isn’t-in-the-other-table:
SELECT DISTINCT a.member_id, a.name
from a LEFT JOIN b USING (member_id, name)
WHERE b.member_id IS NULL


Ïà¹ØÎĵµ£º

tomcat 6.0 + mysql + jndi Êý¾Ý¿âÁ¬½Ó³ØÅäÖÃ

1¡¢Ð½¨¶¯Ì¬webÏîÄ¿¡£
2¡¢Ìí¼Ójar°ü
    ½«mysql jdbcÇý¶¯Ìí¼Óµ½tomcat°²×°Ä¿Â¼ÏµÄlibĿ¼¡£
3¡¢ÔÚMETA-INFÏÂÌí¼Ócontent.xmlÎļþ¡£ÄÚÈÝÈçÏ£º
<?xml version="1.0" encoding="UTF-8"?>
<Context reloadable="true" crossContext="true">
<!-- Default set of monitored resources - ......

²úÆ· °²×°ÖÐµÄ MySql ÂÌ»¯½Ì³Ì

    ×î½üÊÕµ½·´À¡£¬ºÜ¶à¿Í»§Á¬MySql¶¼ÎÞ·¨ÕýÈ·°²×°¡£ÊÕµ½ÈÎÎñ£¬Òª½«MySql´òµ½²úÆ·ÖУ¬ºÍ²úÆ·Ò»Æð°²×°ºÍжÔØ£¬À­¿ª¼Ü
ʽ¸É°É£¬Ã»·¨×Ó¡£
    Ñо¿Ò»Õ󣬷¢ÏÖ½«°²×°ºÃµÄMySqlÎļþ¼ÐCopyµ½ÆäËüµçÄÔÉÏ£¬ÔÙ½â¾öºÃÁ½¸öÎÊÌâÓ¦¸Ã¾Í¿ÉÒԺͰ²×°°æÒ»ÑùÕý³£Ê¹Óá£
1.Copyµ½ÁËÆäËüµçÄÔÉϵIJ»Í¬Ä¿Â¼£¬Ó¦¸ ......

ruby gem mysql on cygwin

1£®    °²×°Cygwin
ÔËÐÐCygwinµÄ°²×°³ÌÐò¡£´ÓÎļû°üµÄµÄÁбíÖУ¬ÔÚDEVÀïÃ棬ȷ¶¨ÒªÑ¡Ôñ
• Ruby
• gcc
• subversion
    ÄãÐèҪʹÓÃgccÀ´½¨Á¢Cygwin°æ±¾µÄMySQL.
2. ÔÚwindowsÉÏÃæ°²×°MYSQL£º
    download MySQL 5.0 Windows Installer
3£®  & ......

ÈçºÎÌá¸ßmysql load data infileµÄËÙ¶È


°æȨÉùÃ÷
£º×ªÔØʱÇëÒÔ³¬Á´½ÓÐÎʽ±êÃ÷ÎÄÕÂԭʼ³ö´¦ºÍ×÷ÕßÐÅÏ¢¼°±¾ÉùÃ÷
http://bbayou.blogbus.com/logs/37045617.html
²âÊÔÊý¾Ý2.5G£¬¹²ÓÐÊý¾Ý9427567Ìõ¡£ÓõÄmysqlµÄlarge·þÎñÆ÷µÄÅäÖá£
load
Ò»´ÎÐèÒª´ó¸Å10·ÖÖÓ×óÓÒ¡£
½¨µÄ±íÓõÄÊÇMYISAM£¬µ÷ÕûÁ˼¸¸ösessionµÄ²ÎÊýÖµ
SET

SESSION

BULK_INSERT_BUFFER_S ......

ÈçºÎÑ¡ÔñºÏÊʵÄmysql´æ´¢ÒýÇæ

    ÔÚÑ¡Ôñ´æ´¢ÒýÇæʱ£¬Ó¦¸ù¾ÝÓ¦ÓÃÌصãÑ¡ÔñºÏÊʵĴ洢ÒýÇ棬¶ÔÓÚ¸´ÔÓµÄÓ¦ÓÃϵͳ¿ÉÒÔ¸ù¾Ýʵ¼ÊÇé¿öÑ¡Ôñ¶àÖÖ´æ´¢ÒýÇæ½øÐÐ×éºÏ¡£
ÏÂÃæÊdz£Óô洢ÒýÇæµÄÊÊÓû·¾³¡£
¡ñMyISAM:ĬÈϵÄMysql²å¼þʽ´æ´¢ÒýÇæ¡£Èç¹ûÓ¦ÓÃÊÇÒÔ¶ÁдºÍ²åÈë²Ù×÷ΪÖ÷£¬Ö»ÓкÜÉÙ¸üкÍɾ³ý²Ù×÷£¬²¢ÇÒ¶ÔÊÂÎñÍêÕûÐÔ£¬²¢·¢ÐÔÒªÇó²»ÊǺܸߣ¬ÄÇÃ´Ñ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ