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

SQLiteµÄ²éѯÓÅ»¯

±¾ÆªÎÄÕÂÀ´Ô´ÓÚ£º¿ª·¢Ñ§Ôº http://edu.codepub.com   Ô­ÎÄÁ´½Ó£ºhttp://edu.codepub.com/2009/0825/14358.php
SQLiteÊǸöµäÐ͵ÄǶÈëʽDBMS£¬ËüÓкܶàÓŵ㣬ËüÊÇÇáÁ¿¼¶µÄ£¬ÔÚ±àÒëÖ®ºóºÜС£¬ÆäÖÐÒ»¸öÔ­Òò¾ÍÊÇÔÚ²éѯÓÅ»¯·½Ãæ±È½Ï¼òµ¥£¬ËüÖ»ÊÇÔËÓÃË÷Òý»úÖÆÀ´½øÐÐÓÅ»¯µÄ£¬¾­¹ý¶ÔSQLiteµÄ²éѯÓÅ»¯µÄ·ÖÎöÒÔ¼°¶ÔÔ´´úÂëµÄÑо¿£¬ÎÒ½«SQLiteµÄ²éѯÓÅ×ܽá
SQLiteÊǸöµäÐ͵ÄǶÈëʽDBMS£¬ËüÓкܶàÓŵ㣬ËüÊÇÇáÁ¿¼¶µÄ£¬ÔÚ±àÒëÖ®ºóºÜС£¬ÆäÖÐÒ»¸öÔ­Òò¾ÍÊÇÔÚ²éѯÓÅ»¯·½Ãæ±È½Ï¼òµ¥£¬ËüÖ»ÊÇÔËÓÃË÷Òý»úÖÆÀ´½øÐÐÓÅ»¯µÄ£¬¾­¹ý¶ÔSQLiteµÄ²éѯÓÅ»¯µÄ·ÖÎöÒÔ¼°¶ÔÔ´´úÂëµÄÑо¿£¬ÎÒ½«SQLiteµÄ²éѯÓÅ×ܽáÈçÏ£º
Ò»¡¢Ó°Ïì²éѯÐÔÄܵÄÒòËØ£º
1£® ¶Ô±íÖÐÐеļìË÷ÊýÄ¿£¬Ô½Ð¡Ô½ºÃ
2£® ÅÅÐòÓë·ñ¡£
3£® ÊÇ·ñÒª¶ÔÒ»¸öË÷Òý¡£
4£® ²éѯÓï¾äµÄÐÎʽ
¶þ¡¢¼¸¸ö²éѯÓÅ»¯µÄת»»
1£® ¶ÔÓÚµ¥¸ö±íµÄµ¥¸öÁжøÑÔ£¬Èç¹û¶¼ÓÐÐÎÈçT.C=exprÕâÑùµÄ×Ӿ䣬²¢ÇÒ¶¼ÊÇÓÃOR²Ù×÷·ûÁ¬½ÓÆðÀ´£¬ÐÎÈ磺 x = expr1 OR expr2 = x OR x = expr3 ´ËʱÓÉÓÚ¶ÔÓÚOR£¬ÔÚSQLiteÖв»ÄÜÀûÓÃË÷ÒýÀ´ÓÅ»¯£¬ËùÒÔ¿ÉÒÔ½«Ëüת»»³É´øÓÐIN²Ù×÷·ûµÄ×Ӿ䣺x IN(expr1,expr2,expr3)ÕâÑù¾Í¿ÉÒÔÓÃË÷Òý½øÐÐÓÅ»¯£¬Ð§¹ûºÜÃ÷ÏÔ£¬µ«ÊÇÈç¹ûÔÚ¶¼Ã»ÓÐË÷ÒýµÄÇé¿öÏÂORÓï¾äÖ´ÐÐЧÂÊ»áÉÔÓÅÓÚINÓï¾äµÄЧÂÊ¡£
2£® Èç¹ûÒ»¸ö×Ó¾äµÄ²Ù×÷·ûÊÇBETWEEN£¬ÔÚSQLiteÖÐͬÑù²»ÄÜÓÃË÷Òý½øÐÐÓÅ»¯£¬ËùÒÔÒ²Òª½øÐÐÏàÓ¦µÄµÈ¼Ûת»»£º È磺a BETWEEN b AND c¿ÉÒÔת»»³É£º(a BETWEEN b AND c) AND (a>=b) AND (a<=c)¡£ ÔÚÉÏÃæÕâ¸ö×Ó¾äÖУ¬ (a>=b) AND (a<=c)½«±»ÉèΪdynamicÇÒÊÇ(a BETWEEN b AND c)µÄ×Ӿ䣬ÄÇôÈç¹ûBETWEENÓï¾äÒѾ­±àÂ룬ÄÇô×Ó¾ä¾ÍºöÂÔ²»¼Æ£¬Èç¹û´æÔÚ¿ÉÀûÓõÄindexʹµÃ×Ó¾äÒѾ­Âú×ãÌõ¼þ£¬ÄÇô¸¸¾äÔò±»ºöÂÔ¡£
3£® Èç¹ûÒ»¸öµ¥ÔªµÄ²Ù×÷·ûÊÇLIKE£¬ÄÇô½«×öÏÂÃæµÄת»»£ºx LIKE ‘abc%’£¬×ª»»³É£ºx>=‘abc’ AND x<‘abd’¡£ÒòΪÔÚSQLiteÖеÄLIKEÊDz»ÄÜÓÃË÷Òý½øÐÐÓÅ»¯µÄ£¬ËùÒÔÈç¹û´æÔÚË÷ÒýµÄ»°£¬Ôòת»»ºóºÍ²»×ª»»Ïà²îºÜÔ¶£¬ÒòΪ¶ÔLIKE²»Æð×÷Ó㬵«Èç¹û²»´æÔÚË÷Òý£¬ÄÇôLIKEÔÚЧÂÊ·½ÃæÒ²»¹ÊDZȲ»ÉÏת»»ºóµÄЧÂʵġ£
Èý¡¢ ¼¸ÖÖ²éѯÓï¾äµÄ´¦Àí£¨¸´ºÏ²éѯ£©
1£®²éѯÓï¾äΪ£º<SelectA> <operator> <selectB> ORDER BY <orderbylist> ORDER BY
     Ö´Ðз½·¨£º is one of UNION ALL, UNION, EXCEPT, or INTERSECT. Õâ¸öÓï¾äµÄÖ´Ðйý³ÌÊÇÏȽ«selectAºÍsele


Ïà¹ØÎĵµ£º

sqlite Êý¾Ý¿â¿ÉÊÓ»¯²é¿´Ð޸ķÖÎö¹¤¾ßsqlitebrowser


SQLite Database Browser
 
 
SQLite Database browser is a light GUI editor for SQLite databases, built on top of Qt. The main goal of the project is to allow non-technical users to create, modify and edit SQLite databases using a set of wizards and a spreadsheet-like interface.
Downlo ......

2010ÄêSQLiteѧϰ±Ê¼ÇÖ®¶þ


2010ÄêSQLiteѧϰ±Ê¼ÇÖ®¶þ
Ò».½¨Á¢Êý¾Ý¿â
sqlite3.exe test.db
 
¶þ.Ë«»÷sqlite-3_6_16Ŀ¼ÏµijÌÐòsqlite3.exe£¬¼´¿ÉÔËÐÐ
Èý.Í˳ö
.exit
»òÕß
.quit
ËÄ.SQLiteÖ§³ÖÈçÏÂ5ÖÖÊý¾ÝÀàÐÍ
1.NULL£º¿ÕÖµ¡£
2.INTEGER£º´ø·ûºÅµÄÕûÐÍ£¬¾ßÌåÈ¡¾öÓдæÈëÊý×ֵķ¶Î§´óС¡£
3.REAL£º¸¡µãÊý×Ö£¬´æ´¢Îª8-byte IEEE¸¡µãÊý ......

SQLite ³õ̽

»¹Êdzõ̽£¬×öµÄÏîÄ¿ÒªÓõ½ÇáÇɵı¾µØÊý¾Ý¿â£¬ÓÚÊÇÕÒÁË sqlite 3 ÊÔÓÃÖ®£¬»¹²»´í£¬¹»ÇáÇÉ¡£
ÉÏÕâ¶ùÈ¥ÏÂÔسÌÐòºÍ²é¿´Îĵµ£º http://www.sqlite.org/download.html
Õâ»Ø¿ª·¢ÓõÄÊÇ C#£¬ÓÚÊÇÕÒÁ˸ö.NETµÄ¿â Finisar.SQLite £¬µ½Õâ¶ùÈ¥ÔØ http://adodotnetsqlite.sourceforge.net/
Òª¼ÇµÄÒ²²»ÊÇʲô´ó²»Á˵Ķ«Î÷£¬Ê¾ÀýÍøÕ¾É϶ ......

Sqlite¼òµ¥½éÉÜÓëһЩ³£ÓõÄÀý×Ó

1:³£ÓýӿÚ
  ¸öÈ˱ȽÏϲ»¶
sqlite,
ʹÓÃ×î·½±ã£¬Î¨Ò»µÄ×¼±¸¹¤×÷ÊÇÏÂÔØ
250K
µÄÔ´£»¶øÇÒ×÷ÕߺÜÈÈÐÄ£¬ÓÐÎʱشð¡£
ÒÔÏÂÑÝʾһÏÂʹÓÃ
sqlite
µÄ²½Ö裬ÏÈ´´½¨Ò»¸öÊý¾Ý¿â£¬È»ºó²éѯÆäÖеÄÄÚÈÝ¡£
2
¸öÖØÒª½á¹¹ÌåºÍ
5
¸öÖ÷Òªº¯Êý£º
sqlite3            &nbs ......

sqlite²éѯÊý¾Ý¿âÖдæÔÚµÄËùÓбí

from within a C/C++ program (or a script using Tcl/Ruby/Perl/Python
bindings) you can get access to table and index names by doing a SELECT
on a special table named "SQLITE_MASTER
". Every SQLite database has an SQLITE_MASTER table that defines the schema for the database.
SQL code
S ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ