Êý¾Ý¿âµÄÊÂÎñºÍËø»úÖÆ£¨SQL Server£©
˵µ½ÊÂÎñ£¬Ê×ÏÈÎÒÃǾÍÒªÖªµÀΪʲôÐèÒªÊÂÎñ£¬Õâ¾ÍÒªÏÈ¿´¿´Ëø»úÖƵÄÏà¹Ø¸ÅÄ
ËøµÄ¸ÅÊö
Ò». ΪʲôҪÒýÈëËø
¶à¸öÓû§Í¬Ê±¶ÔÊý¾Ý¿âµÄ²¢·¢²Ù×÷ʱ»á´øÀ´ÒÔÏÂÊý¾Ý²»Ò»ÖµÄÎÊÌâ:
¶ªÊ§¸üÐÂ
A,BÁ½¸öÓû§¶ÁͬһÊý¾Ý²¢½øÐÐÐÞ¸Ä,ÆäÖÐÒ»¸öÓû§µÄÐ޸Ľá¹ûÆÆ»µÁËÁíÒ»¸öÐ޸ĵĽá¹û,±ÈÈ綩Ʊϵͳ
Ôà¶Á
AÓû§ÐÞ¸ÄÁËÊý¾Ý,ËæºóBÓû§ÓÖ¶Á³ö¸ÃÊý¾Ý,µ«AÓû§ÒòΪijЩÔÒòÈ¡ÏûÁ˶ÔÊý¾ÝµÄÐÞ¸Ä,Êý¾Ý»Ö¸´ÔÖµ,´ËʱBµÃµ½µÄÊý¾Ý¾ÍÓëÊý¾Ý¿âÄÚµÄÊý¾Ý²úÉúÁ˲»Ò»ÖÂ
²»¿ÉÖظ´¶Á
AÓû§¶ÁÈ¡Êý¾Ý,ËæºóBÓû§¶Á³ö¸ÃÊý¾Ý²¢ÐÞ¸Ä,´ËʱAÓû§ÔÙ¶ÁÈ¡Êý¾Ýʱ·¢ÏÖÇ°ºóÁ½´ÎµÄÖµ²»Ò»ÖÂ
»ÃÏñ¶Á
AÓû§¶ÁÈ¡Êý¾Ý,ËæºóBÓû§²åÈë/ɾ³ýÁ˼¸ÌõÊý¾Ý,´ËʱAÓû§ÔÙ¶ÁÈ¡Êý¾Ýʱ·¢ÏÖÊý¾ÝÌõÊý²»Ò»ÖÂ
²¢·¢¿ØÖƵÄÖ÷Òª·½·¨ÊÇ·âËø,Ëø¾ÍÊÇÔÚÒ»¶Îʱ¼äÄÚ½ûÖ¹Óû§×öijЩ²Ù×÷ÒÔ±ÜÃâ²úÉúÊý¾Ý²»Ò»ÖÂ
¶þ ËøµÄ·ÖÀà
ËøµÄÀà±ðÓÐÁ½ÖÖ·Ö·¨£º
1. ´ÓÊý¾Ý¿âϵͳµÄ½Ç¶ÈÀ´¿´£º·ÖΪ¶ÀÕ¼Ëø£¨¼´ÅÅËüËø£©£¬¹²ÏíËøºÍ¸üÐÂËø
MS-SQL Server ʹÓÃÒÔÏÂ×ÊÔ´Ëøģʽ¡£
Ëøģʽ ÃèÊö
¹²Ïí (S) ÓÃÓÚ²»¸ü¸Ä»ò²»¸üÐÂÊý¾ÝµÄ²Ù×÷£¨Ö»¶Á²Ù×÷£©£¬Èç SELECT Óï¾ä¡£
¸üР(U) ÓÃÓڿɸüеÄ×ÊÔ´ÖС£·ÀÖ¹µ±¶à¸ö»á»°ÔÚ¶ÁÈ¡¡¢Ëø¶¨ÒÔ¼°Ëæºó¿ÉÄܽøÐеÄ×ÊÔ´¸üÐÂʱ·¢Éú³£¼ûÐÎʽµÄËÀËø¡£
ÅÅËü (X) ÓÃÓÚÊý¾ÝÐ޸IJÙ×÷£¬ÀýÈç INSERT¡¢UPDATE »ò DELETE¡£È·±£²»»áͬʱͬһ×ÊÔ´½øÐжàÖظüС£
ÒâÏòËø ÓÃÓÚ½¨Á¢ËøµÄ²ã´Î½á¹¹¡£ÒâÏòËøµÄÀàÐÍΪ£ºÒâÏò¹²Ïí (IS)¡¢ÒâÏòÅÅËü (IX) ÒÔ¼°ÓëÒâÏòÅÅËü¹²Ïí (SIX)¡£
¼Ü¹¹Ëø ÔÚÖ´ÐÐÒÀÀµÓÚ±í¼Ü¹¹µÄ²Ù×÷ʱʹÓ᣼ܹ¹ËøµÄÀàÐÍΪ£º¼Ü¹¹ÐÞ¸Ä (Sch-M) ºÍ¼Ü¹¹Îȶ¨ÐÔ (Sch-S)¡£
´óÈÝÁ¿¸üР(BU) Ïò±íÖдóÈÝÁ¿¸´ÖÆÊý¾Ý²¢Ö¸¶¨ÁË TABLOCK ÌáʾʱʹÓá£
¹²ÏíËø
¹²Ïí (S) ËøÔÊÐí²¢·¢ÊÂÎñ¶ÁÈ¡ (SELECT) Ò»¸ö×ÊÔ´¡£×ÊÔ´ÉÏ´æÔÚ¹²Ïí (S) Ëøʱ£¬ÈκÎÆäËüÊÂÎñ¶¼²»ÄÜÐÞ¸ÄÊý¾Ý¡£Ò»µ©ÒѾ¶ÁÈ¡Êý¾Ý£¬±ãÁ¢¼´ÊÍ·Å×ÊÔ´ÉϵĹ²Ïí (S) Ëø£¬³ý·Ç½«ÊÂÎñ¸ôÀ뼶±ðÉèÖÃΪ¿ÉÖظ´¶Á»ò¸ü¸ß¼¶±ð£¬»òÕßÔÚÊÂÎñÉú´æÖÜÆÚÄÚÓÃËø¶¨Ìáʾ±£Áô¹²Ïí (S) Ëø¡£
¸üÐÂËø
¸üР(U) Ëø¿ÉÒÔ·Àֹͨ³£ÐÎʽµÄËÀËø¡£Ò
Ïà¹ØÎĵµ£º
SQL ServerȨÏÞ¹ÜÀí²ßÂÔ
Êý¾Ý¿â½¨Á¢Ö®ºó£¬Êý¾ÝµÄ°²È«¾ÍÏÔµÃÓÈΪÖØÒª£¬¶ÔÓÚÒ»¸öÊý¾Ý¿â¹ÜÀíÔ±À´Ëµ£¬°²È«ÐÔ¾ÍÒâζ×ÅËû±ØÐë±£Ö¤ÄÇЩ¾ßÓÐÌØÊâÊý¾Ý·ÃÎÊȨÏÞµÄÓû§Äܹ»µÇ¼µ½SQL Server£¬²¢ÇÒÄܹ»·ÃÎÊÊý¾ÝÒÔ¼°¶ÔÊý¾Ý¿â¶ÔÏóʵʩ¸÷ÖÖȨÏÞ·¶Î§ÄڵIJÙ×÷£»Í¬Ê±£¬Ëû»¹Òª·ÀÖ¹ËùÓеķÇÊÚȨÓû§µÄ·Ç·¨²Ù×÷¡£Õý»ùÓÚ´Ë£¬SQL Server 2000ÌṩÁ ......
SQL¸ß¼¶Ê¹ÓÃ
SELECT¸ß¼¶²éѯ
´íÎó´¦Àí
ÊÂÎñ´¦Àí
Êý¾ÝµÄËø¶¨
Óαê
1.SELECT¸ß¼¶²éѯ
Ç°ÃæÒѾ½éÉÜÁËSELECTÓï¾äµÄÓ÷¨£¬±¾½ÚÖ÷Òª½éÉÜÊý¾Ý»ã×Ü¡¢Áª½Ó²éѯ¡¢×Ó²éѯºÍ¹Ø¼ü´ÊUNIONµÄʹÓá£
(1)Êý¾Ý»ã×Ü
Ϊ¾ö²ßÖ§³ÖϵͳÉú³É¾ÛºÏÊÂÎñµÄ»ã×ܱ¨±íÊÇÒ»ÏÔÓ²¢ÇÒÏ൱ÏûºÄ×ÊÔ´µÄ¹¤×÷¡£SQL Server 2000ÌṩÁ½¸öÁé»îÇÒÇ¿´óµÄ×é¼þ ......
SQL Server 2008¼òÌåÖÐÎÄÆóÒµ°æÏÂÔØ£º
thunder://QUFodHRwOi8vd3d3LnF1aWNrOC5jbi9kb3duLmFzcD9pZD0xMjM2JnNpZD0wWlo=
±¾DVD°üº¬ÁËx86 x64 ia64 ÈýÖÖCPUģʽµÄ°²×°³ÌÐò¡£°æ±¾ºÅΪ£º 10.0.1600.22
ÐòÁкţº
¿ª·¢°æ(Developer): PTTFM-X467G-P7RH2-3Q6CG-4DMYB
ÆóÒµ°æ(Enterprise): JD8Y6-HQG69-P9H84-XDTPG-34MBB ......
sqlͳ¼Æ£¹ØÓÚѧÉú³É¼¨(´ð°¸)
http://blog.sina.com.cn/s/blog_61380b320100ej9p.html
´ð°¸£º
1. ¼ÆËãÿ¸öÈ˵Ä×ܳɼ¨²¢ÅÅÃû
select name,sum(score) as allscore from stuscore group by name order by allscore
2. &nbs ......
##################################################
# ÉùÃ÷£º
# ±¾ÎÄת×ÔCSDN£¬Óû§ID£ºhtl258
# ÔÌûµØÖ·£ºhttp://blog.csdn.net/htl258/archive/2010/05/12/5582744.aspx
####### ......