SQLÓï¾äЧÂÊÎÊÌâµÄ¼¸µã×ܽá
1. SQLÓÅ»¯µÄÔÔòÊÇ£º
½«Ò»´Î²Ù×÷ÐèÒª¶ÁÈ¡µÄBLOCKÊý¼õµ½×îµÍ,¼´ÔÚ×î¶ÌµÄʱ¼ä´ïµ½×î´óµÄÊý¾ÝÍÌÍÂÁ¿¡£
µ÷Õû²»Á¼SQLͨ³£¿ÉÒÔ´ÓÒÔϼ¸µãÇÐÈ룺
¼ì²é²»Á¼µÄSQL£¬¿¼ÂÇÆäд·¨ÊÇ·ñ»¹ÓпÉÓÅ»¯ÄÚÈÝ
¼ì²é×Ó²éѯ ¿¼ÂÇSQL×Ó²éѯÊÇ·ñ¿ÉÒÔÓüòµ¥Á¬½ÓµÄ·½Ê½½øÐÐÖØÐÂÊéд
¼ì²éÓÅ»¯Ë÷ÒýµÄʹÓÃ
¿¼ÂÇÊý¾Ý¿âµÄÓÅ»¯Æ÷
2. ±ÜÃâ³öÏÖSELECT * from table Óï¾ä£¬ÒªÃ÷È·²é³öµÄ×ֶΡ£
3. ÔÚÒ»¸öSQLÓï¾äÖУ¬Èç¹ûÒ»¸öwhereÌõ¼þ¹ýÂ˵ÄÊý¾Ý¿â¼Ç¼Խ¶à£¬
¶¨Î»Ô½×¼È·£¬Ôò¸ÃwhereÌõ¼þÔ½Ó¦¸ÃÇ°ÒÆ¡£
4. ²éѯʱ¾¡¿ÉÄÜʹÓÃË÷Òý¸²¸Ç¡£¼´¶ÔSELECTµÄ×ֶν¨Á¢¸´ºÏË÷Òý£¬
ÕâÑù²éѯʱֻ½øÐÐË÷ÒýɨÃ裬²»¶ÁÈ¡Êý¾Ý¿é¡£
5. ÔÚÅжÏÓÐÎÞ·ûºÏÌõ¼þµÄ¼Ç¼ʱ½¨Òé²»ÒªÓÃSELECT COUNT £¨*£©ºÍselect top 1 Óï¾ä¡£
6. ʹÓÃÄÚ²ãÏÞ¶¨ÔÔò£¬ÔÚƴдSQLÓï¾äʱ£¬½«²éѯÌõ¼þ·Ö½â¡¢·ÖÀ࣬
²¢¾¡Á¿ÔÚSQLÓï¾äµÄ×îÀï²ã½øÐÐÏÞ¶¨£¬ÒÔ¼õÉÙÊý¾ÝµÄ´¦ÀíÁ¿¡£
7. Ó¦¾ø¶Ô±ÜÃâÔÚorder by×Ó¾äÖÐʹÓñí´ïʽ¡£
8. Èç¹ûÐèÒª´Ó¹ØÁª±í¶ÁÊý¾Ý£¬¹ØÁªµÄ±íÒ»°ã²»Òª³¬¹ý7¸ö¡£
9. СÐÄʹÓà IN ºÍ OR£¬ÐèҪעÒâIn¼¯ºÏÖеÄÊý¾ÝÁ¿¡£½¨Ò鼯ºÏÖеÄÊý¾Ý²»³¬¹ý200¸ö¡£
10. <> Óà < ¡¢ > ´úÌ棬>ÓÃ>=´úÌ棬<ÓÃ<=´úÌ棬ÕâÑù¿ÉÒÔÓÐЧµÄÀûÓÃË÷Òý¡£
11. ÔÚ²éѯʱ¾¡Á¿¼õÉÙ¶Ô¶àÓàÊý¾ÝµÄ¶ÁÈ¡°üÀ¨¶àÓàµÄÁÐÓë¶àÓàµÄÐС£
12. ¶ÔÓÚ¸´ºÏË÷ÒýҪעÒ⣬ÀýÈçÔÚ½¨Á¢¸´ºÏË÷ÒýʱÁеÄ˳ÐòÊÇF1£¬F2£¬F3£¬
ÔòÔÚwhere»òorder by×Ó¾äÖÐÕâЩ
Ïà¹ØÎĵµ£º
1.Óà CUBE »ã×ÜÊý¾Ý
CUBE ÔËËã·ûÉú³ÉµÄ½á¹û¼¯ÊǶàάÊý¾Ý¼¯¡£¶àάÊý¾Ý¼¯ÊÇÊÂʵÊý¾ÝµÄÀ©Õ¹£¬ÊÂʵÊý¾Ý¼´¼Ç¼¸ö±ðʼþµÄÊý¾Ý¡£À©Õ¹½¨Á¢ÔÚÓû§´òËã·ÖÎöµÄÁÐÉÏ¡£ÕâЩÁб»³ÆΪά¡£¶àάÊý¾Ý¼¯ÊÇÒ»¸ö½á¹û¼¯£¬ÆäÖаüº¬Á˸÷ά¶ÈµÄËùÓпÉÄÜ×éºÏµÄ½»²æ±í¸ñ¡£ CUBE ÔËËã·ûÔÚ SELECT Óï¾äµÄ GROUP BY ×Ó¾äÖÐÖ¸¶¨¡£¸ÃÓï¾äµÄÑ¡ÔñÁбíÓ ......
SUBSTRING
·µ»Ø×Ö·û¡¢binary¡¢text »ò image ±í´ïʽµÄÒ»²¿·Ö¡£ÓйؿÉÓë¸Ãº¯ÊýÒ»ÆðʹÓõÄÓÐЧ Microsoft® SQL Server ......
-- ================================================
-- Template generated from Template Explorer using:
-- Create Procedure (New Menu).SQL
--
-- Use the Specify Values for Template Parameters
-- command (Ctrl-Shift-M) to fill in the parameter
-- values below.
--
-- This block of comm ......
ÿÌ죬ÿÖܵÄÖ´ÐÐ
±ÈÈç¿ÉÒÔ¿ØÖÆÿÌìÖ»ÄÜͶƱÈý´Î¡£
ÿÖÜҪͳ¼ÆÒ»ÏÂͶƱÊý¡£
1¡¢Äã±ØÐ뿪Æô´úÀí·þÎñsql server agent
2¡¢ÔÚÆóÒµ¹ÜÀíÆ÷À´ò¿ª“¹ÜÀí—>sqlserver´úÀí—>×÷Òµ”£¬ÐÂÔö×÷Òµ£¬Ð½¨“²½Ö蔣¬ÔÚ²½ÖèÀïÌîÈëÄãҪתÒƵÄSQLÓï¾äµ½“ÃüÁòÀȻºóн¨“µ ......
--> Title : SQL Server 2005EXCEPTºÍINTERSECTÔËËã·û
--> Author : wufeng4552
--> Date : 2009-10-30
(Ò»)¸ÅÄî
EXCEPTºÍINTERSECTÔËËã·ûʹÄú¿ÉÒԱȽÏÁ½¸ö»ò¶à¸öSELECTÓï¾äµÄ½á¹û²¢·µ»Ø·ÇÖظ´Öµ¡£
(¶þ)區別
EXCEPTÔËËã·û·µ»ØÓÉEXCEPTÔËËã·û×ó²àµÄ²éѯ·µ»Ø¡¢¶øÓÖ² ......