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

SQL DROP TABLEµÄÓ÷¨

ÓÐʱºòÎÒÃÇ»á¾ö¶¨ÎÒÃÇÐèÒª´ÓÊý¾Ý¿âÖÐÇå³ýÒ»¸ö±í¸ñ¡£ÊÂʵÉÏ£¬Èç¹ûÎÒÃDz»ÄÜÕâÑù×öµÄ»°£¬Äǽ«»áÊÇÒ»¸öºÜ´óµÄÎÊÌ⣬ÒòΪÊý¾Ý¿â¹ÜÀíʦ (Database Administrator -- DBA) ÊƱØÎÞ·¨¶ÔÊý¾Ý¿â×öÓÐЧÂʵĹÜÀí¡£»¹ºÃ£¬SQL ÓÐÌṩһ¸ö DROP TABLEµÄÓï·¨À´ÈÃÎÒÃÇÇå³ý±í¸ñ¡£ DROP TABLE µÄÓï·¨ÊÇ£º
DROP TABLE "±í¸ñÃû"
ÎÒÃÇÈç¹ûÒªÇå³ýÔÚSQL CREATE Öн¨Á¢µÄ¹Ë¿Í±í¸ñ£¬ÎÒÃǾʹòÈ룺
DROP TABLE customer.


Ïà¹ØÎĵµ£º

º½¿Õ¹«Ë¾¹ÜÀíϵͳ(VC++ ÓëSQL 2005)

ϵͳ»·¾³£ºWindows 7
Èí¼þ»·¾³£ºVisual C++ 2008 SP1 +SQL Server 2005
±¾´ÎÄ¿µÄ£º±àдһ¸öº½¿Õ¹ÜÀíϵͳ
      ÕâÊÇÊý¾Ý¿â¿Î³ÌÉè¼ÆµÄ³É¹û£¬ËäÈ»³É¼¨²»¼Ñ£¬µ«ÊÇ×÷ΪÎÒÓÃVC++ ÒÔÀ´±àдµÄ×î´ó³ÌÐò»¹ÊÇ´«µ½ÍøÉÏ£¬ÒÔ¹©²Î¿¼¡£ÓÃVC++ ×öÊý¾Ý¿âÉè¼Æ²¢²»ÈÝÒ×£¬µ«Ò²²»ÊDz»¿ÉÄÜ¡£ÒÔÏÂÊÇÎҵijÌÐò½çÃ棬ºóÃæ ......

SQL UNIONµÄÓ÷¨

UNION Ö¸ÁîµÄÄ¿µÄÊǽ«Á½¸ö SQL Óï¾äµÄ½á¹ûºÏ²¢ÆðÀ´¡£´ÓÕâ¸ö½Ç¶ÈÀ´¿´£¬ UNION ¸ú JOIN ÓÐЩÐíÀàËÆ£¬ÒòΪÕâÁ½¸öÖ¸Á¿ÉÒÔÓɶà¸ö±í¸ñÖÐߢȡ×ÊÁÏ¡£ UNION µÄÒ»¸öÏÞÖÆÊÇÁ½¸ö SQL Óï¾äËù²úÉúµÄÀ¸Î»ÐèÒªÊÇͬÑùµÄ×ÊÁÏÖÖÀà¡£ÁíÍ⣬µ±ÎÒÃÇÓà UNIONÕâ¸öÖ¸Áîʱ£¬ÎÒÃÇÖ»»á¿´µ½²»Í¬µÄ×ÊÁÏÖµ (ÀàËÆ SELECT DISTINCT)¡£
UNION µÄÓï·¨ÈçÏ ......

SQL UNION ALLµÄÓ÷¨

UNION ALL Õâ¸öÖ¸ÁîµÄÄ¿µÄÒ²ÊÇÒª½«Á½¸ö SQL Óï¾äµÄ½á¹ûºÏ²¢ÔÚÒ»Æð¡£ UNION ALL ºÍ UNION ²»Í¬Ö®´¦ÔÚÓÚ UNION ALL »á½«Ã¿Ò»±Ê·ûºÏÌõ¼þµÄ×ÊÁ϶¼ÁгöÀ´£¬ÎÞÂÛ×ÊÁÏÖµÓÐÎÞÖظ´¡£
UNION ALL µÄÓï·¨ÈçÏ£º
[SQL Óï¾ä 1]
UNION ALL
[SQL Óï¾ä 2]
ÎÒÃÇÓúÍÉÏһҳͬÑùµÄÀý×ÓÀ´ÏÔʾ³ö UNION ALL ºÍ UNION µÄ²»Í¬¡£Í¬Ñù¼ÙÉèÎÒÃÇ ......

SQL SUBSTRINGµÄÓ÷¨

SQL ÖÐµÄ substring º¯ÊýÊÇÓÃÀ´×¥³öÒ»¸öÀ¸Î»×ÊÁÏÖеÄÆäÖÐÒ»²¿·Ö¡£Õâ¸öº¯ÊýµÄÃû³ÆÔÚ²»Í¬µÄ×ÊÁÏ¿âÖв»ÍêÈ«Ò»Ñù£º
MySQL: SUBSTR(), SUBSTRING()
Oracle: SUBSTR()
SQL Server: SUBSTRING()
×î³£Óõ½µÄ·½Ê½ÈçÏ (ÔÚÕâÀïÎÒÃÇÓÃSUBSTR()ΪÀý)£º
SUBSTR(str,pos): ÓÉ<str>ÖУ¬Ñ¡³öËùÓдӵÚ<pos>λÖÿªÊ¼µÄ× ......

SQL ÍâÀ´¼üµÄÓ÷¨

ÍâÀ´¼üÊÇÒ»¸ö(»òÊý¸ö)Ö¸ÏòÁíÍâÒ»¸ö±í¸ñÖ÷¼üµÄÀ¸Î»¡£ÍâÀ´¼üµÄÄ¿µÄÊÇÈ·¶¨×ÊÁϵIJο¼ÍêÕûÐÔ(referential integrity)¡£»»ÑÔÖ®£¬Ö»Óб»×¼ÐíµÄ×ÊÁÏÖµ²Å»á±»´æÈë×ÊÁÏ¿âÄÚ¡£
¾ÙÀýÀ´Ëµ£¬¼ÙÉèÎÒÃÇÓÐÁ½¸ö±í¸ñ£ºÒ»¸ö CUSTOMER ±í¸ñ£¬ÀïÃæ¼Ç¼ÁËËùÓй˿͵Ä×ÊÁÏ£»ÁíÒ»¸ö ORDERS ±í¸ñ£¬ÀïÃæ¼Ç¼ÁËËùÓй˿Ͷ©¹ºµÄ×ÊÁÏ¡£ÔÚÕâÀïµÄÒ»¸öÏÞÖÆ£¬ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ