Sqlite3³£ÓÃSQLÓï¾ä×ܽᣬһÊÇ·ÀÖ¹×Ô¼ºÍüÁË£¬¶þÊÇ·ÖÏí
ÎÄÖеÄSQL¶¼ÊÇ´ÓÎÒµÄÏîÄ¿ÖÐÖ±½Ócopy¹ýÀ´£¬Òò´ËºÜ¶à±íÃûʲô¶¼ÓÐÁË
//´´½¨±í
"CREATE TABLE FEED_TABLE(FeedID TEXT, Title TEXT, Summary TEXT, Author TEXT, ImageName VARCHAR(21), ImageType TEXT, MaxIndex INT, ImageData BLOB)"
//²éѯ¼Ç¼
"select * form 'table_name'"
"select * form 'table name' where value = '?'"
//²åÈë¼Ç¼
"INSERT INTO FEED_TABLE(FeedID, Title, Summary, ImageName, ImageType, MaxIndex) VALUES('%s', '%s', '%s', '%s', '%s', %d)"
//¸üмǼ
"update 'table_name' 'column_name' = 'value'"
//ɾ³ý¼Ç¼
"DELETE from FAVORITE_TABLE WHERE EntryIndex = %d"
//ɾ³ýËùÓмǼ
"delete from 'table_name'"
//ɾ³ý±í
"drop table 'table_name'"
//²éѯ±í½á¹¹
"select sql from sqlite_master where name = 'table_name'"
callbackµÄµÚÈý¸ö²ÎÊý
ÁíÍâ,sqlite3ÊÇÖ§³ÖÊÂÎñµÄ
int result;
result = sqlite3_exec( db, "begin transaction", 0, 0, &zErrorMsg ); //¿ªÊ¼Ò»¸öÊÂÎñ
result = sqlite3_exec( db, "commit transaction", 0, 0, &zErrorMsg ); //Ìá½»ÊÂÎñ
result = sqlite3_exec( db, "rollback transaction", 0, 0, &zErrorMsg ); //»Ø¹öÊÂÎñ
Ïà¹ØÎĵµ£º
select 1 from ...£¬ sqlÓï¾äÖеÄ1´ú±íʲôÒâ˼£¿²é³öÀ´ÊǸöʲô½á¹û£¿
select 1 from table;Óëselect anycol(Ä¿µÄ±í¼¯ºÏÖеÄÈÎÒâÒ»ÐУ© from table;Óëselect * from table ´Ó×÷ÓÃÉÏÀ´ËµÊÇûÓвî±ðµÄ£¬¶¼ÊDz鿴ÊÇ·ñÓмǼ£¬Ò»°ãÊÇ×÷Ìõ¼þ²éѯÓõġ£select 1 from Ö ......
MS SQLµÄһЩ¾µä³£ÓòÙ×÷Óï¾ä»ã×Ü ¡¾http://hi.baidu.com/kychen88/blog/item/b3c8e7d960821b3c32fa1cee.html¡¿
1.°´ÐÕÊϱʻÅÅÐò:
Select * from TableName Order By CustomerName Collate Chinese_PRC_Stroke_ci_as
2.Êý¾Ý¿â¼ÓÃÜ:
select encrypt('ÔʼÃÜÂë')
select pwdencrypt('ÔʼÃÜÂë')
select pwdcomp ......
Äܼà¿ØSQL ServerÊý¾Ý¿âÔËÐеÄÇé¿ö£¬¶Ô·þÎñÆ÷À´Ëµ¶¼ÊÇÒ»¼þ·Ç³£ÖØÒªµÄÊ£¬ÏÂÃ濪ʼ½éÉÜ¡£
Microsoft SQL Server 2005 ÌṩÁËһЩ¹¤¾ßÀ´¼à¿ØÊý¾Ý¿â¡£·½·¨Ö®Ò»ÊǶ¯Ì¬¹ÜÀíÊÓͼ¡£¶¯Ì¬¹ÜÀíÊÓͼ (DMV) ºÍ¶¯Ì¬¹ÜÀíº¯Êý (DMF) ·µ»ØµÄ·þÎñÆ÷״̬ÐÅÏ¢¿ÉÓÃÓÚ¼à¿Ø·þÎñÆ÷ʵÀýµÄÔËÐÐ×´¿ö¡¢Õï¶ÏÎÊÌâºÍÓÅ»¯ÐÔÄÜ¡£
³£¹æ·þÎñÆ÷¶¯Ì¬¹ÜÀí¶ÔÏó°ü ......
1¡¢²éѯÈýÃŹ¦¿Î¶¼ÔÚ80·ÖÒÔÉϵÄͬѧÐÕÃû(Ò»ÌõsqlÓï¾ä)
name kecheng fenshu
ÕÅÈý ÓïÎÄ 78
ÕÅÈý Êýѧ 81
ÕÅÈý  ......
1¡¢SQL ServerÈÕÆÚÊý¾Ý¿âÄÚ²¿±íʾ¼°²éѯÊä³ö£º
SQL ServerÄÚ²¿¶ÔDateTimeÀàÐ͵ıíʾÊÇÓÃ8¸ö×Ö½ÚÀ´±íʾ£¬ÆäÖÐÇ°4¸ö×Ö½Ú±íʾµÄÊýֵΪ×Ô1900Äê1ÔÂ1ÈÕÁãʱÒÔÀ´µÄÌìÊý£¬ºóËĸö×Ö½ÚÊÇÌìÊýÖ®ÍâµÄÓжàÉÙ¸ö1/300Ã룬ÕâҲ˵Ã÷SQL ServerÄÚ²¿±íʾʱ¼äµÄ¾«¶ÈΪ1/300Ã룬Լ3.3ºÁÃë¡£
³£¹æµÄSQL²éѯ£¬Õý³£ÈÕÆÚÊä³ö¸ñʽΪ:yyyy-MM-dd hh: ......