mysqlµÄ´óÅúÁ¿µ¼ÈëÊý¾ÝsqlÓï¾äµÄÒ»µãÓÅ»¯
´óÅúÁ¿²åÈëÊý¾Ýʱ 1,myisam±í,¿ÉÒÔÏÈͨ¹ý alter table table_name disable keys;#ÏȹرձíµÄË÷Òý¼ì²é,×¢ÒâÊÇ·ÇΨһË÷Òý! load data infile ¡®/path/file¡¯ into table table_name; alter table table_name anable keys;#ÔÙ´ò¿ªË÷Òý ¿É´ó´ó¼Ó¿ìµ¼Èë.»¹ÓпÉÒÔÉèÖÃbulk_insert_buffer_sizeÖµÀ´Ìá¸ß²åÈëËÙ¶È 2,innodb±í,ÉÏÃæ·½·¨²»Ôõô´ÕЧ ¿ÉÒÔ¶ÔÊý¾Ý°´Ö÷¼ü½øÐÐÅÅÐò,ÒòΪinnodbÊÇ°´Ö÷¼ü˳Ðò±£´æÊý¾ÝµÄ;ÔÚµ¼ÈëÊý¾Ý֮ǰ¿ÉÒÔÏȹرÕΨһË÷ÒýЧÑé set unique_checks=0; Èç¹ûÓÐ×Ô¶¯Ìá½»,ÏÈ¹Ø±Õ set autocommit=0;
Ïà¹ØÎĵµ£º
select top ÿҳÏÔʾµÄ¼Ç¼Êý * from topic where id not in (select top £¨µ±Ç°µÄÒ³Êý-1£©×ÿҳÏÔʾµÄ¼Ç¼Êý id from topic order by id desc) order by id desc
select top ÿҳÏÔʾµÄ¼Ç¼Êý * from topic where id not in (select top £¨µ±Ç°µÄÒ³Êý-1£©×ÿҳÏÔʾµÄ¼Ç¼Êý id from topic order by id desc) ......
----start
ÔÚSQLÓï¾äÖÐÓ¦¸Ã¾¡Á¿±ÜÃâʹÓÃOR£¬ÒòΪÕâÑù×ö»áÓ°ÏìSQLÓï¾äµÄÐÔÄÜ¡£¿¼ÂÇÏÂÃæµÄÇé¿ö£º
CREATE TABLE USER
(
NAME VARCHAR(20) NOT NULL,---ÐÕÃû
BIRTHDAY DATE---ÉúÈÕ
);
ÏÖÔÚÓÐÕâÑùÒ»¸öÎÊÌ⣺ÈÃÄã²éÕÒÒ»ÏÂÉúÈÕÊÇ1949-10-1£¨¹²ºÍ¹úͬÁäÈË£©»ò1978-12-18£¨Ê®Ò»½ìÈýÖÐÈ«»áÕÙ¿ªÊ±¼ä£© ......
transaction 1:
------------------------------------------------------
begin transaction
update table1 set cola = 'str1'
Waitfor time '10:12:00'
update table2 set colb = 'str2'
rollback transaction
transaction 2:
---- ......
Ò» sqlÓï¾äµÄÖ´Ðв½Öè
1£©Óï·¨·ÖÎö£¬·ÖÎöÓï¾äµÄÓï·¨ÊÇ·ñ·ûºÏ¹æ·¶£¬ºâÁ¿Óï¾äÖи÷±í´ïʽµÄÒâÒå¡£
2£© ÓïÒå·ÖÎö£¬¼ì²éÓï¾äÖÐÉæ¼°µÄËùÓÐÊý¾Ý¿â¶ÔÏóÊÇ·ñ´æÔÚ£¬ÇÒÓû§ÓÐÏàÓ¦µÄȨÏÞ¡£
3£©ÊÓͼת»»£¬½«Éæ¼°ÊÓͼµÄ²éѯÓï¾äת»»ÎªÏàÓ¦µÄ¶Ô»ù±í²éѯÓï¾ä¡£
4£©±í´ïʽת»»£¬ ½«¸´Ô SQL ±í´ïʽת»»Îª½Ï¼òµ¥µÄµÈЧÁ¬½Ó±í´ïʽ¡ ......
1.µ½http://www.oracle.com/technology/global/cn/software/tech/oci/instantclient/htdocs/winsoft.htmlÏÂÔØ
11.1.0.7.0 °æµÄ¼´Ê±¿Í»§¶Ë³ÌÐò°ü — Basic£¨²»ÊÇBasic Lite£©
2.½«ÏÂÔص½µÄÎļþ½âѹ£¬½âѹºóÎÒ½«Ä¿Â¼instantclient_11_1ÀïµÄÈ«²¿Îļþ¿½±´µ½ÁËÒ»¸öеÄĿ¼£ºE:\programs\OracleClient¡£ÄãÒ²¿ÉÒÔ²»¿½±´£¬Ö ......