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

SQL ¸½¼ÓÊý¾Ý¿âʱ³öÏÖ ÎÞ·¨´ò¿ªÎïÀíÎļþ´íÎó

SQL ¸½¼ÓÊý¾Ý¿âʱ³öÏÖ ÎÞ·¨´ò¿ªÎïÀíÎļþ´íÎó
´íÎóÐÅÏ¢:
Ö´ÐÐ Transact-SQL Óï¾ä»òÅú´¦Àíʱ·¢ÉúÁËÒì³£¡£ (Microsoft.SqlServer.ConnectionInfo)
------------------------------
ÎÞ·¨´ò¿ªÎïÀíÎļþ "D:\SqlDataBase\Test.mdf"¡£²Ù×÷ϵͳ´íÎó 5:"5(¾Ü¾ø·ÃÎÊ¡£)"¡£ (Microsoft SQL Server£¬´íÎó: 5120)
½â¾ö°ì·¨:
  win7ÏÂÒÔ¹ÜÀíÔ±Éí·ÝÔËÐÐ SQL Êý¾Ý¿â ¼´¿É
 »òÕß
 ¶Ï¿ªsaµÇ½ ÒÔwindows·½Ê½µÇ½


Ïà¹ØÎĵµ£º

SQL Server 2005ÖеÄT SQLÔöÇ¿(7) ͨÓñí±í´ïʽCTE

ͨÓñí±í´ïʽ Common Table Expressions
ͨÓñí±í´ïʽ£¨CTE£©ÊÇÒ»¸ö¿ÉÒÔÓɶ¨ÒåÓï¾äÒýÓõÄÁÙʱ±íÃüÃûµÄ½á¹û¼¯¡£ÔÚËûÃǵļòµ¥ÐÎʽÖУ¬Äú¿ÉÒÔ½«CTEÊÓΪÀàËÆÓÚÊÓͼºÍÅÉÉú±í»ìºÏ¹¦ÄܵĸĽø°æ±¾¡£ÔÚ²éѯµÄfrom×Ó¾äÖÐÒýÓÃCTEµÄ·½Ê½ÀàËÆÓÚÒýÓÃÅÉÉú±íºÍÊÓͼµÄ·½Ê½¡£Ö»Ð붨ÒåCTEÒ»´Î£¬¼´¿ÉÔÚ²éѯÖжà´ÎÒýÓÃËü¡£ÔÚCTEµÄ¶¨ÒåÖУ¬¿ÉÒÔÒ ......

sql²éѯͬһ×Ö¶ÎÖµÊÇ·ñ´æÔÚÏàͬ¼Ç¼

SELECT *
from Ds_WasteBook
WHERE (Ds_WasteBook_Desc IN
          (SELECT Ds_WasteBook_Desc
         from Ds_WasteBook
         GROUP BY Ds_WasteBook_Desc
  &nb ......

¹ØÓÚSQLÖÐcountµÄЧÂÊ

COUNT(*)ÓëCOUNT(COL)
ÍøÉÏËÑË÷ÁËÏ£¬·¢ÏÖ¸÷ÖÖ˵·¨¶¼ÓУº
±ÈÈçÈÏΪCOUNT(COL)±ÈCOUNT(*)¿ìµÄ£»
ÈÏΪCOUNT(*)±ÈCOUNT(COL)¿ìµÄ£»
»¹ÓÐÅóÓѺܸãЦµÄ˵µ½Õâ¸öÆäʵÊÇ¿´ÈËÆ·µÄ¡£
ÔÚ²»¼ÓWHEREÏÞÖÆÌõ¼þµÄÇé¿öÏ£¬COUNT(*)ÓëCOUNT(COL)»ù±¾¿ÉÒÔÈÏΪÊǵȼ۵ģ»
µ«ÊÇÔÚÓÐWHEREÏÞÖÆÌõ¼þµÄÇé¿öÏ£¬COUNT(*)»á±ÈCOUNT(COL)¿ì·Ç³£¶à ......

SQL×¢Èë

      Ëæ×ÅB/SģʽӦÓÿª·¢µÄ·¢Õ¹£¬Ê¹ÓÃÕâÖÖģʽ±àдӦÓóÌÐòµÄ³ÌÐòÔ±Ò²Ô½À´Ô½¶à¡£µ«ÊÇÓÉÓÚÕâ¸öÐÐÒµµÄÈëÃÅÃż÷²»¸ß£¬³ÌÐòÔ±µÄˮƽ¼°¾­ÑéÒ²²Î²î²»Æ룬Ï൱´óÒ»²¿·Ö³ÌÐòÔ±ÔÚ±àд´úÂëµÄʱºò£¬Ã»ÓжÔÓû§ÊäÈëÊý¾ÝµÄºÏ·¨ÐÔ½øÐÐÅжϣ¬Ê¹Ó¦ÓóÌÐò´æÔÚ°²È«Òþ»¼¡£Óû§¿ÉÒÔÌá½»Ò»¶ÎÊý¾Ý¿â²éѯ´úÂ룬¸ù¾Ý³ÌÐò ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ