SQLÓï¾äÓÅ»¯·½·¨
1.Ö»²éѯÐèÒªµÄÁУ¬²»ÓÃ*
2.INÊʺÏÓÚÍâ±í´ó¶øÄÚ±íСµÄÇé¿ö£»EXISTSÊʺÏÓÚÍâ±íС¶øÄÚ±í´óµÄÇé¿ö 1¡¢Éý¼¶Ó²¼þ
2¡¢¸ù¾Ý²éѯÌõ¼þ,½¨Á¢Ë÷Òý,ÓÅ»¯Ë÷Òý¡¢ÓÅ»¯·ÃÎÊ·½Ê½£¬ÏÞÖƽá¹û¼¯µÄÊý¾ÝÁ¿¡£
3¡¢À©´ó·þÎñÆ÷µÄÄÚ´æ
4¡¢Ôö¼Ó·þÎñÆ÷CPU¸öÊý
5¡¢¶ÔÓÚ´óµÄÊý¾Ý¿â²»ÒªÉèÖÃÊý¾Ý¿â×Ô¶¯Ôö³¤£¬Ëü»á½µµÍ·þÎñÆ÷µÄÐÔÄÜ
6¡¢ÔÚ²éѯSelectÓï¾äÖÐÓÃWhere×Ö¾äÏÞÖÆ·µ»ØµÄÐÐÊý,±ÜÃâ±íɨÃè,Èç¹û·µ»Ø²»±ØÒªµÄÊý¾Ý£¬ÀË·ÑÁË·þÎñÆ÷µÄI/O×ÊÔ´£¬¼ÓÖØÁËÍøÂçµÄ¸ºµ£½µµÍÐÔÄÜ¡£Èç¹û±íºÜ´ó£¬ÔÚ±íɨÃèµÄÆڼ佫±íËøס£¬½ûÖ¹ÆäËûµÄÁª½Ó·ÃÎʱí,ºó¹ûÑÏÖØ¡£
7¡¢²éѯʱ²»Òª·µ»Ø²»ÐèÒªµÄÐС¢ÁÐ
8¡¢ÓÃselect top 100 / 10 Percent À´ÏÞÖÆÓû§·µ»ØµÄÐÐÊý»òÕßSET ROWCOUNTÀ´ÏÞÖƲÙ×÷µÄÐÐ
9¡¢ÔÚINºóÃæÖµµÄÁбíÖУ¬½«³öÏÖ×îƵ·±µÄÖµ·ÅÔÚ×îÇ°Ã棬³öÏÖµÃ×îÉٵķÅÔÚ×îºóÃ棬¼õÉÙÅжϵĴÎÊý
10¡¢Ò»°ãÔÚGROUP BY ¸öHAVING×Ö¾ä֮ǰ¾ÍÄÜÌÞ³ý¶àÓàµÄÐУ¬ËùÒÔ¾¡Á¿²»ÒªÓÃËüÃÇÀ´×öÌÞ³ýÐеŤ×÷¡£ËûÃǵÄÖ´ÐÐ˳ÐòÓ¦¸ÃÈçÏÂ×îÓÅ£º
selectµÄWhere×Ö¾äÑ¡ÔñËùÓкÏÊʵÄÐУ¬Group ByÓÃÀ´·Ö×é¸öͳ¼ÆÐУ¬Having×Ö¾äÓÃÀ´ÌÞ³ý¶àÓàµÄ·Ö×é¡£ÕâÑùGroup By ¸öHavingµÄ¿ªÏúС£¬²éѯ¿ì.¶ÔÓÚ´óµÄÊý¾ÝÐнøÐзÖ×éºÍHavingÊ®·ÖÏûºÄ×ÊÔ´¡£Èç¹ûGroup BYµÄÄ¿µÄ²»°üÀ¨¼ÆË㣬ֻÊÇ·Ö×飬ÄÇôÓÃDistinct¸ü¿ì
11¡¢Ò»´Î¸üжàÌõ¼Ç¼±È·Ö¶à´Î¸üÐÂÿ´ÎÒ»Ìõ¿ì,¾ÍÊÇ˵Åú´¦ÀíºÃ MS SQL Server²éѯÓÅ»¯·½·¨
²éѯËÙ¶ÈÂýµÄÔÒòºÜ¶à£¬³£¼ûÈçϼ¸ÖÖ 1¡¢Ã»ÓÐË÷Òý»òÕßûÓÐÓõ½Ë÷Òý(ÕâÊDzéѯÂý×î³£¼ûµÄÎÊÌ⣬ÊdzÌÐòÉè¼ÆµÄȱÏÝ)
2¡¢I/OÍÌÍÂÁ¿Ð¡£¬ÐγÉÁËÆ¿¾±Ð§Ó¦¡£
3¡¢Ã»Óд´½¨¼ÆËãÁе¼Ö²éѯ²»ÓÅ»¯¡£
4¡¢ÄÚ´æ²»×ã
5¡¢ÍøÂçËÙ¶ÈÂý
6¡¢²éѯ³öµÄÊý¾ÝÁ¿¹ý´ó£¨¿ÉÒÔ²ÉÓöà´Î²éѯ£¬ÆäËûµÄ·½·¨½µµÍÊý¾ÝÁ¿£©
7¡¢Ëø»òÕßËÀË
Ïà¹ØÎĵµ£º
Ò»¡¢SQL SERVER ºÍACCESSµÄÊý¾Ýµ¼Èëµ¼³ö
³£¹æµÄÊý¾Ýµ¼Èëµ¼³ö£º
ʹÓÃDTSÏòµ¼Ç¨ÒÆÄãµÄAccessÊý¾Ýµ½SQL Server£¬Äã¿ÉÒÔʹÓÃÕâЩ²½Öè:
¡¡¡¡¡ð1ÔÚSQL SERVERÆóÒµ¹ÜÀíÆ÷ÖеÄTools£¨¹¤¾ß£©²Ëµ¥ÉÏ£¬Ñ¡ÔñData Transformation
¡¡¡¡¡ð2Services£¨Êý¾Ýת»»·þÎñ£©£¬È»ºóÑ¡Ôñ czdImport Dat ......
http://www.umgr.com/blog/PostView.aspx?bpId=36294
1. Ö´ÐÐsqlÓï¾ä
int sqlite3_exec(sqlite3*£¬ const char *sql£¬ sqlite3_callbacksql Óï·¨
£¬ void *£¬ char **errmsg );
Õâ¾ÍÊÇÖ´ÐÐÒ»Ìõ sql Óï¾äµÄº¯Êý¡£
µÚ1¸ö²ÎÊý²»ÔÙ˵ÁË£¬ÊÇÇ°Ãæopenº¯ÊýµÃµ½µÄÖ¸Õ롣˵ÁËÊǹؼüÊý¾Ý½á¹¹¡£
µÚ2¸ö²ÎÊýconst char ......
µ¼³ö±í½á¹¹:
Tools-->Export User Objects -->Ñ¡ÔñÒªµ¼³öµÄ±í(°üÀ¨SequenceµÈ)-->.sqlÎļþ
µ¼³ö±íÊý¾Ý:
Tools-->Export Tables-->Ñ¡Ôñ±í,Ñ¡ÔñSQL Inserts-->.sqlÎļþ
Ö´ÐÐÕâЩ.sqlÎļþʱ,ҪʹÓÃн¨Command WindowÀ´Ö´ÐÐ. ......
Êý¾Ý¿â±íµÄ¼Ç¼Èç¹ûÌ«¶à£¬±ÈÈç´ïµ½ÁË20ÍòÒÔÉÏ£¬ÔÚbosÖÐÒ»´ÎÐÔ²é¼Ç¼×ö´¦Àí¿ÉÄÜ»á³öÏÖoutofmemoryµÄ´íÎó£¬ÎÒÃÇÖ»ÄܲÉÈ¡·Ö¶ÎÈ¡¼Ç¼À´´¦Àí£¬¾ßÌåʾÀýÈçÏ£º
/*dialect*/
With Cust AS
( SELECT fnumber,
ROW_NUMBER() OVER (order by fnumber) as RowNumber  ......
/*dialect*/
With Cust AS
( SELECT fnumber,
ROW_NUMBER() OVER (order by id) as RowNumber
from t_bd_currency)
select *
from Cust
Where RowNumber Between 20 and 30
//
  ......