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

Êý¾Ý¿âsqlµÄÌØÊâ×Ö·û£º

Êý¾Ý¿âsqlµÄÌØÊâ×Ö·û£º
1£©µ¥ÒýºÅ’£ºÀýÈçstring a = “this is marry’s book.”;
             Ê¹ÓÃinsertʱ¾Í»á³ö´í¡£
             ½â¾ö£ºa= a.Replace("'","''");
2£©°Ù·ÖºÅ% £ºÀýÈçstring a = “50%”;
             Ê¹ÓÃlike²éѯ£¬²é³ö´øÓÐ50%µÄËùÓмǼ£¬Ôò»á±»ÈÏΪÊÇͨÅä·û¡£
             ½â¾ö£ºSelect * from tbl where name LIKE '%/%%'  ESCAPE '/' 
 ¼´a=a.Replace("%","/%%")
 »òÕß[%]
3£©Ï»®Ïß_ £ºÀýÈç string a = “m_n”;
              Ê¹ÓÃlike²éѯ£¬select * from tbl where name like ‘%m_n%’,Ï»®Ïß±»ÈÏΪÊÇͨÅä·û¡£
              ½â¾ö£º[_]
 
4£©·½À¨ºÅ[]£ºÖ÷ÒªÊÇ×óÀ¨ºÅ£º[[]
5£©¼âÀ¨ºÅ^£º[^]


Ïà¹ØÎĵµ£º

SQL²Ù×÷È«¼¯

ÏÂÁÐÓï¾ä²¿·ÖÊÇMssqlÓï¾ä£¬²»¿ÉÒÔÔÚaccessÖÐʹÓá£
SQL·ÖÀࣺ
DDL—Êý¾Ý¶¨ÒåÓïÑÔ(CREATE£¬ALTER£¬DROP£¬DECLARE)
DML—Êý¾Ý²Ù×ÝÓïÑÔ(SELECT£¬DELETE£¬UPDATE£¬INSERT)
DCL—Êý¾Ý¿ØÖÆÓïÑÔ(GRANT£¬REVOKE£¬COMMIT£¬ROLLBACK)
Ê×ÏÈ,¼òÒª½éÉÜ»ù´¡Óï¾ä£º
1¡¢ËµÃ÷£º´´½¨Êý¾Ý¿â
CREATE DATABASE data ......

MFCÖÐÓÃado·ÃÎÊSQL Server 2005Êý¾Ý¿â

MFCÖÐÓÃado·ÃÎÊSQL Server 2005Êý¾Ý¿â
½ñÌìÀÏ´ó½»´úÏîÄ¿£¬ÐèÒªMFC·ÃÎÊÁíһ̨»úÆ÷É쵀 SQL Server 2005Êý¾Ý¿â¡£MFCÎÒ²»Ê죬SQLÒ²´ÓûÓùý¡£ÔÚÍøÉϲéÁ˲»ÉÙ×ÊÁÏ£¬Ã¦ÁËÒ»ÕóÖÕÓÚ¸ãͨÁË¡£Óë¸÷λÅóÓÑ·ÖÏíһϣ¬¸ßÊÖÃǾͲ»Óÿ´ÁË£¬ÕâÊÇд¸øÏñÎÒÒ»Ñù³õѧÕߵġ£
Ò»¡¢°²×°SQL SERVER 2005£¬ÔÚ±¾»ú½¨Á¢·þÎñÆ÷ĬÈÏ°²×°¼´¿É£¬Ò²¿ÉÒÔ×Ô¼ ......

±È½ÏÁ½ÌõSQLÓï¾äÔËÐÐʱ¼ä

create   proc   dbo.PROC_SQL_COMP   @sql1   varchar(8000),@sql2   varchar(8000),@t   int  
  as  
  /*  
  µ÷Óãºexec   dbo.PROC_SQL_COMP   @sql1='',@sql2='',@t=5 & ......

SQLÓÅ»¯¼°UNION ALLÌæ´úUNION

OracleÓкܶàÖµµÃѧϰµÄµØ·½£¬ÕâÀïÎÒÃÇÖ÷Òª½éÉÜOracle UNION ALL£¬°üÀ¨½éÉÜUNIONµÈ·½Ã档ͨ³£Çé¿öÏ£¬ÓÃUNIONÌæ»»WHERE×Ó¾äÖеÄOR½«»áÆ𵽽ϺõÄЧ¹û¡£¶ÔË÷ÒýÁÐʹÓÃOR½«Ôì³ÉÈ«±íɨÃè¡£×¢Ò⣬ÒÔÉϹæÔòÖ»Õë¶Ô¶à¸öË÷ÒýÁÐÓÐЧ¡£¼ÙÈçÓÐcolumnûÓб»Ë÷Òý£¬²éѯЧÂÊ¿ÉÄÜ»áÒòΪÄúûÓÐÑ¡ÔñOR¶ø½µµÍ¡£ÔÚÏÂÃæµÄÀý×ÓÖУ¬LOC_ID ºÍREGION ......

SQLÊ¡ÊÐÇøÈý¼¶±í ˵ÉùллÔÙÄÃ

-- ±íµÄ½á¹¹ area
DROP TABLE  area;
CREATE TABLE  area (
  id int NOT NULL ,
  areaID int NOT NULL,
  area varchar(200) NOT NULL,
  fatherID int NOT NULL,
  PRIMARY KEY  (id)
)
DROP TABLE city;
CREATE TABLE  city select
  id int NOT NULL ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ