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

sql 2005 rownumÓ÷¨ÒÔ¼°´øorder by ×Ó²éѯµÄÓ÷¨

--   sql   2005
  1.rownumÓ÷¨
  select   *   from(  
          Select   rownum=row_number()   over(order   by   1),*   from   table
  )a   where   rownum   between   1     and   10
  2.´øorder by ×Ó²éѯµÄÓ÷¨
sleect * from(select TOP 100 percent * from table order id )  a


Ïà¹ØÎĵµ£º

¹ØÓÚsql¸ü¸Ä¼ÆËã»úÃûºÍ·þÎñÆ÷ÃûÒ»Ö»ò"´íÎó 18483

½ñÌìÔÚÅäÖÃÊý¾Ý¿â·¢²¼ºÍ·Ö·¢Ê±×ÜÊDZ¨³öÏÖ 18483 ´íÎó
Ìáʾ˵£º´íÎó 18483:δÄÜÁ¬½Óµ½·þÎñÆ÷ "XXX"£¬ÒòΪ 'distributor_admin'δÔڸ÷þÎñÆ÷É϶¨ÒåΪԶ³ÌµÇ½¡£
Îҵķ¢²¼ºÍ·Ö·¢ÊÇͬһ¸ö·þÎñÆ÷£¬"XXX" ΪÎҵĻúÆ÷Ãû£¬·Ö·¢Êý¾Ý¿âÊÇĬÈϵÄÃû³Æ£¬¶øÎÒÔÚÁíÍâһ̨»úÆ÷ÉÏ×öʱ¾ÍÕý³£¡£
1¡¢ÉèÖù²Ïí¸´ÖÆĿ¼:
      ......

SQL SERVERÐÔÄÜÓÅ»¯ TempdbÏà¹ØÎÊÌâ

TEMPDB²»Ö§³Ö×Ô¶¯Ñ¹Ëõ£¬ÇÒËüµÄÊý¾Ý¿âºÍÎļþѹËõÄÜÁ¦ÊÇÓÐÏÞÖƵģ»
Èç²»µÃ²»Ñ¹ËõTEMPDBµÄ´óС£¬½¨ÒéʹÓÃÀëÏß¹¦ÄÜ£¬ÈçϲÙ×÷£º
1.Í£Ö¹SQL SERVER·þÎñ£»
2.ÕÒµ½sqlservr.exeÔÚ´ÅÅÌÖеÄλÖã»
3.ʹÓÃsqlservr.exeÊäÈëÃüÁîsqlservr -c -f,ÕâÑùÆô¶¯SQL SERVERʱ£¬TEMPDBµÄ´óСÄܹ»±£³Ö×îС£»
4.ʹÓÃTSQLÃüÁALTER DATA ......

SQL SERVERÐÔÄÜ·ÖÎö ËÀËø¼ì²âÊý¾Ý¿â×èÈûÓï¾ä

×÷ÖÐÊý¾Ý¿â¾­³£³ö´íËÀËø£¬²¢ÇÒ»¹ÒªÒªÇó½â¾öµ±Ç°µÄËÀËø£¬ÎÊÌâ¶à¶à£»
²ÎÕÕCSDN£¬Öйú·ç(Roy)һƪËÀËøÎÄÕ²¢¸Ä½øÁËÏ£»
/***********************************************************************************************************************
ÕûÀíÈË£ººÚľÑÂÉϵÄÎÏÅ£(lenolotus) ÈÕÆÚ:2009.04.28
************ ......

DB2 SQLÐÔÄÜÓÅ»¯Ïà¹ØµÄ10´óÒªËØ

ÏÂÃæÌá³öÁË10ÌõºÍDB2 SQLÐÔÄÜÏà¹ØµÄ10ÌõÒòËØ£º
1¡¢ÌṩÊʵ±µÄͳ¼ÆÐÅÏ¢
¶ÔDB2ÓÅ»¯¹ÜÀíÆ÷£¨otimizer£©¶øÑÔ£¬ÈçºÎ¸ü¼ÓÓÐЧµÄÖ´ÐÐSQLÓï¾äÊÇÓÉ´æÔÚÓÚDB2 catalogÖеÄͳ¼ÆÐÅÏ¢¾ö¶¨µÄ£¬ÓÅ»¯Æ÷ÀûÓÃÕâЩÐÅÏ¢¾ö¶¨×îÓÅ»¯µÄ·¾¶¡£
Òò´Ë£¬ÎªÁ˱£³ÖϵͳÄܹ»×ö³ö×î¼ÑÑ¡Ôñ£¬ÐèÒª¾­³£µÄÔËÐÐRunstatsÃüÁÀ´±£³Öϵͳͳ¼ÆÐÅÏ¢µÄ¼°Ê±ÓÐЧ¡£Ô ......

¸ßЧSQL²éѯ֮Ë÷Òý£¨II£©

ÉÏ»ØÎÒÃÇ˵µ½ÆÀ¹ÀÒ»ÌõÓï¾äÖ´ÐÐЧÂÊÖ÷Òª¿´Âß¼­ IO £¨É¶ÊÇÂß¼­ IO £¬É¶ÊÇÎïÀí IO ¼ûÁª»úÎĵµ£©£¬Õâ´ÎÎÒÃǼÌÐø¡£
ÎÒÃÇÏÈ˵˵£¬·µ»Ø¶àÐнá¹ûʱ£¬ÎªÊ²Ã´ SQLServer ÓÐʱ»áÑ¡Ôñ index seek £¬ÓÐʱ»áÑ¡Ôñ index scan ¡£
ÒÔ nonclustered index ΪÀý˵Ã÷¡£
ÏñËùÓеÄË÷Òý B Ê÷Ò»Ñù£¬·Ç¾Û¼¯Ë÷ÒýÊ÷Ò²°üÀ¨ÍêÈ«ÓÉË÷ÒýÊý¾Ý×é³ÉµÄ¸ù½ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ