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
Ïà¹ØÎĵµ£º
¡¡¡¾IT168 ¼¼ÊõÎĵµ¡¿¹ÊÊ¿ªÆª£ºÄãºÍÄãµÄÍŶӾ¹ý²»Ð¸Å¬Á¦£¬ÖÕÓÚʹÍøÕ¾³É¹¦ÉÏÏߣ¬¸Õ¿ªÊ¼Ê±£¬×¢²áÓû§½ÏÉÙ£¬ÍøÕ¾ÐÔÄܱíÏÖ²»´í£¬µ«Ëæ×Å×¢²áÓû§µÄÔö¶à£¬·ÃÎÊËٶȿªÊ¼±äÂý£¬Ò»Ð©Óû§¿ªÊ¼·¢À´Óʼþ±íʾ¿¹Ò飬ÊÂÇé±äµÃÔ½À´Ô½Ô㣬ΪÁËÁôסÓû§£¬Ä㿪ʼ×ÅÊÖµ÷²é·ÃÎʱäÂýµÄÔÒò¡£
¡¡¡¡¾¹ý½ôÕŵĵ÷²é£¬Äã·¢ÏÖÎÊÌâ³öÔÚÊý¾Ý¿âÉÏ£¬µ±Ó¦ ......
¡¡¾ÍÈçͬÊý¾Ý¿âDBAÁ˽âµÄÒ»Ñù£¬ºÏÊʵÄË÷ÒýÄܹ»Ìá¸ß²éѯÐÔÄܺÍÓ¦ÓóÌÐò¿É²âÁ¿ÐÔ¡£µ«ÊÇÿ¸ö¸½¼ÓµÄË÷Òý£¬¶¼¸øϵͳÔö¼ÓÁ˶îÍ⿪Ïú£¬ÒòΪËæ×ÅÊý¾Ý´Ó±íºÍÊÓͼÖ⻶ÏÔö¼Ó¡¢Ð޸ĻòÇå³ý£¬SQL ServerÐèҪά»¤ÕâЩË÷Òý¡£
¡¡¡¡Ö®Ç°£¬ÎÒ½éÉÜÁËһ϶¯Ì¬¹ÜÀíÊÓͼ(DMV)¡£ËüÊÇÒ»ÖÖºÜÓÐÓõļà¿ØºÍ½â¾öSQL Server¹ÊÕϵŤ¾ß¡£±¾ÎÄÊÇËüµÄÐøƪ£¬ ......
×÷ΪһÃûÊý¾Ý¿âDBA£¬¿Ï¶¨»áÌý˵¹ý“tempdbÊý¾Ý¿âÂúÁË”¡£Í¨³£ÎÒÃǺÜÈÝÒ×È·¶¨Ôì³ÉÕâÒ»ÎÊÌâµÄÔÒò¡£µ«ÊǸü¶àµÄʱºòÕâÒ»ÎÊÌâÖ÷ÒªÔ´ÓÚÒ»×éÇëÇó£¬Éæ¼°µ½Ð´úÂ벿Êð»òÖð½¥Ôö¼ÓµÄÊý¾Ý¡£
¡¡¡¡“TempdbÂúÁË”Òâζ×Åʲô?
¡¡¡¡µ±SQL Server tempdbÂúÁËʱ£¬Éϲã¹ÜÀí³£³£ÐèÒª¾ö²ß¡¢Ò»Ð©¿ª·¢ÈËÔ±¿ÉÄÜ»áÍÆжÔðÈΣ¬¾ ......
Statement µÄ execute(sql) ·½·¨µÄ·µ»ØÖµ
true if the first result is a ResultSet object;
false if it is an update count or there are no ......
NOLOCKºÍREADPASTµÄÇø±ð¡£
1.¿ªÆôÒ»¸öÊÂÎñÖ´ÐвåÈëÊý¾ÝµÄ²Ù×÷¡£
BEGIN TRAN t
INSERT INTO Customer
SELECT 'a','a'
2.Ö´ÐÐÒ»Ìõ²éѯÓï¾ä¡£
SELECT * from Customer WITH (NOLOCK)
½á¹ûÖÐÏÔʾ”a”ºÍ”a”¡£µ±1ÖÐÊÂÎñ»Ø¹öºó£¬ÄÇôa½«³ÉΪÔàÊý¾Ý¡£(×¢:1ÖеÄÊÂÎñδÌá½») ¡£NOLOCK±íÃ÷ûÓжÔÊý¾Ý±íÌ ......