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

SQLÖаѲéѯ³öÀ´µÄ½á¹ûÓöººÅÁ¬½ÓÆðÀ´

SELECT A,B=stuff((select ' ' + '×Ö¶ÎC£º' + C + ',×Ö¶ÎD£º'  + D) + ';'  from tbl WHERE (key= 'Ìõ¼þ') for xml path('')) , 1 , 1 ,'')
from tbl
WHERE (key= 'Ìõ¼þ')
group by key
ÀýÈ磺һ¸ö±íÖÐkeyΪAAµÄ¼Ç¼ÓÐ2Ìõ£¬µÚÒ»ÌõÖÐ×Ö¶ÎCµÄֵΪCC£¬×Ö¶ÎDµÄֵΪDD£¬µÚ¶þÌõÖÐ×Ö¶ÎCµÄֵΪCCC£¬×Ö¶ÎDµÄֵΪDDD£¬ÄÇôִÐиÄÓï¾äºóµÄ½á¹ûΪ£ºA=AA,B=CC,DD;CCC,DDD


Ïà¹ØÎĵµ£º

Ê®²½ÓÅ»¯SQL ServerÖеÄÊý¾Ý·ÃÎÊ

¡¡¡¾IT168 ¼¼ÊõÎĵµ¡¿¹ÊÊ¿ªÆª£ºÄãºÍÄãµÄÍŶӾ­¹ý²»Ð¸Å¬Á¦£¬ÖÕÓÚʹÍøÕ¾³É¹¦ÉÏÏߣ¬¸Õ¿ªÊ¼Ê±£¬×¢²áÓû§½ÏÉÙ£¬ÍøÕ¾ÐÔÄܱíÏÖ²»´í£¬µ«Ëæ×Å×¢²áÓû§µÄÔö¶à£¬·ÃÎÊËٶȿªÊ¼±äÂý£¬Ò»Ð©Óû§¿ªÊ¼·¢À´Óʼþ±íʾ¿¹Ò飬ÊÂÇé±äµÃÔ½À´Ô½Ô㣬ΪÁËÁôסÓû§£¬Ä㿪ʼ×ÅÊÖµ÷²é·ÃÎʱäÂýµÄÔ­Òò¡£
¡¡¡¡¾­¹ý½ôÕŵĵ÷²é£¬Äã·¢ÏÖÎÊÌâ³öÔÚÊý¾Ý¿âÉÏ£¬µ±Ó¦ ......

ÀûÓö¯Ì¬¹ÜÀíÊÓͼÌá¸ßSQL ServerË÷ÒýЧÂÊ

¡¡¾ÍÈçͬÊý¾Ý¿âDBAÁ˽âµÄÒ»Ñù£¬ºÏÊʵÄË÷ÒýÄܹ»Ìá¸ß²éѯÐÔÄܺÍÓ¦ÓóÌÐò¿É²âÁ¿ÐÔ¡£µ«ÊÇÿ¸ö¸½¼ÓµÄË÷Òý£¬¶¼¸øϵͳÔö¼ÓÁ˶îÍ⿪Ïú£¬ÒòΪËæ×ÅÊý¾Ý´Ó±íºÍÊÓͼÖ⻶ÏÔö¼Ó¡¢Ð޸ĻòÇå³ý£¬SQL ServerÐèҪά»¤ÕâЩË÷Òý¡£
¡¡¡¡Ö®Ç°£¬ÎÒ½éÉÜÁËһ϶¯Ì¬¹ÜÀíÊÓͼ(DMV)¡£ËüÊÇÒ»ÖÖºÜÓÐÓõļà¿ØºÍ½â¾öSQL Server¹ÊÕϵŤ¾ß¡£±¾ÎÄÊÇËüµÄÐøƪ£¬ ......

ÔÚSQL Server tempdbÂúʱ¼ì²éÊý¾ÝÎļþ

×÷ΪһÃûÊý¾Ý¿âDBA£¬¿Ï¶¨»áÌý˵¹ý“tempdbÊý¾Ý¿âÂúÁË”¡£Í¨³£ÎÒÃǺÜÈÝÒ×È·¶¨Ôì³ÉÕâÒ»ÎÊÌâµÄÔ­Òò¡£µ«ÊǸü¶àµÄʱºòÕâÒ»ÎÊÌâÖ÷ÒªÔ´ÓÚÒ»×éÇëÇó£¬Éæ¼°µ½Ð´úÂ벿Êð»òÖð½¥Ôö¼ÓµÄÊý¾Ý¡£
¡¡¡¡“TempdbÂúÁË”Òâζ×Åʲô?
¡¡¡¡µ±SQL Server tempdbÂúÁËʱ£¬Éϲã¹ÜÀí³£³£ÐèÒª¾ö²ß¡¢Ò»Ð©¿ª·¢ÈËÔ±¿ÉÄÜ»áÍÆжÔðÈΣ¬¾ ......

Statement µÄ execute(sql) ·½·¨µÄ·µ»ØÖµ

Statement µÄ  execute(sql) ·½·¨µÄ·µ»ØÖµ
 true   if   the   first   result   is   a   ResultSet   object;  
 
 false   if   it   is   an   update   count   or   there   are   no ......

SQLËø»úÖƺÍÊÂÎñ¸ôÀ뼶±ð£¨×ª£©

NOLOCKºÍREADPASTµÄÇø±ð¡£
1.¿ªÆôÒ»¸öÊÂÎñÖ´ÐвåÈëÊý¾ÝµÄ²Ù×÷¡£
BEGIN TRAN t
INSERT INTO Customer
SELECT 'a','a'
2.Ö´ÐÐÒ»Ìõ²éѯÓï¾ä¡£
SELECT * from Customer WITH (NOLOCK)
½á¹ûÖÐÏÔʾ”a”ºÍ”a”¡£µ±1ÖÐÊÂÎñ»Ø¹öºó£¬ÄÇôa½«³ÉΪÔàÊý¾Ý¡£(×¢:1ÖеÄÊÂÎñδÌá½») ¡£NOLOCK±íÃ÷ûÓжÔÊý¾Ý±íÌ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ