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

SQL ServerÃæÊÔÌâÕûºÏ

 3¡£±íÄÚÈÝÈçÏÂ
-----------------------------
ID            LogTime
1            2008/10/10 10:00:00
1            2008/10/10 10:03:00
1            2008/10/10 10:09:00
2 ¡¡¡¡¡¡2008/10/10 10:10:00
2 ¡¡¡¡¡¡2008/10/10 10:11:00
......
-----------------------------
ÇëÎʸ÷λ¸ßÊÖ£¬ÈçºÎ²éѯµÇ½ʱ¼ä¼ä¸ô²»³¬¹ý£µ·ÖÖÓµÄËùÓмǼ£®
¼¸µÀ¾­µäµÄSQL±ÊÊÔÌâÄ¿£¨Óд𰸣©
£¨2£©±íÃû£º³É¼¨±í
ÐÕÃû   ¿Î³Ì       ·ÖÊý
ÕÅÈý     ÓïÎÄ       81
ÕÅÈý     Êýѧ       75
ÀîËÄ     ÓïÎÄ       56
ÀîËÄ     Êýѧ       90
ÍõÎå     ÓïÎÄ       81
ÍõÎå     Êýѧ       100
ÍõÎå     Ó¢Óï       49
……
£¨ÆäËûÓû§ÊµÑéµÄ¼Ç¼´ó¼Ò¿É×ÔÐвåÈ룩
¸ø³ö³É¼¨È«²¿ºÏ¸ñµÄѧÉúÐÅÏ¢£¨°üº¬ÐÕÃû¡¢¿Î³Ì¡¢·ÖÊý£©£¬×¢£º·ÖÊýÔÚ60ÒÔÉÏÆÀΪºÏ¸ñ
select * from score
where s_name not in
(select s_name from score
where score<60)
»òÕߣº
select * from score where s_name in
(select s_name from score
group by s_name
having min(score)>=60)
£¨3£©±íÃû£ºÉÌÆ·±í
Ãû³Æ   ²úµØ             ½ø¼Û
Æ»¹û   ÑĮ̀                2.5
Æ»¹û   ÔÆÄÏ                1.9
Æ»¹û   ËÄ´¨              &


Ïà¹ØÎĵµ£º

Excel¡¢SQL¡¢VS6.0¡¢ÌرðÊÇ´¦ÀíListCtrlÓëExcel

Ò»¡¢¹ØÓÚCREATE TABLE tab1 (×Ö¶ÎÃû TEXT)ÖУ¬×Ö¶ÎÃûΪ“a.a.a»òa.a.b”ʱ£¬Ìáʾ£º
“×ֶζ¨ÒåÓï·¨´íÎó”
´ð£ºÔÚ×Ö¶ÎÃû×ÖÍâÃæ¼ÓÉÏ“[ ]”¾Í¿ÉÒÔÁË£¡
¶þ¡¢´´½¨Ò»¸öÒÔListCtrlµÚÒ»ÁÐΪEXCELµÚÒ»Ðеıí½á¹¹ ºÍ ²åÈëÒ»¸öÒÔListCtrlµÚNÁÐΪEXCELµÚ¶þÐеıí½á¹¹
      ......

ÔÚSQL Server 2005Êý¾Ý¿âÖÐʵÏÖ×Ô¶¯±¸·Ý

 
ÔÚSQL Server 2005Êý¾Ý¿âÖÐʵÏÖ×Ô¶¯±¸·ÝµÄ¾ßÌå²½Öè:
1¡¢´ò¿ªSQL Server Management Studio
2¡¢Æô¶¯SQL Server´úÀí
3¡¢µã»÷×÷Òµ->н¨×÷Òµ
4¡¢"³£¹æ"ÖÐÊäÈë×÷ÒµµÄÃû³Æ
5¡¢Ð½¨²½Ö裬ÀàÐÍÑ¡T-SQL£¬ÔÚÏÂÃæµÄÃüÁîÖÐÊäÈëÏÂÃæÓï¾ä£¨ºìÉ«²¿·ÖÒª¸ù¾Ý×Ô¼ºµÄʵ¼ÊÇé¿ö¸ü¸Ä£¬D:\sql2005\\back\¸ÄΪ×Ô¼ºµÄ ......

SQLÐÔÄÜÓÅ»¯£¨²»¶Ï×ܽᣩ


1.²éѯµÄÄ£ºýÆ¥Åä
¡¡¡¡¾¡Á¿±ÜÃâÔÚÒ»¸ö¸´ÔÓ²éѯÀïÃæʹÓà LIKE '%parm1%'—— ºìÉ«±êʶλÖõİٷֺŻᵼÖÂÏà¹ØÁеÄË÷ÒýÎÞ·¨Ê¹Óã¬×îºÃ²»ÒªÓá£
¡¡¡¡½â¾ö°ì·¨:
¡¡¡¡ÆäʵֻÐèÒª¶Ô¸Ã½Å±¾ÂÔ×ö¸Ä½ø£¬²éѯËٶȱã»áÌá¸ß½ü°Ù±¶¡£¸Ä½ø·½·¨ÈçÏ£º
      ¡¡¡¡a¡¢ÐÞ¸Äǰ̨³ÌÐò—&mdas ......

SQL Server 2005 ·ÖÇø±íʵ¼ù——·ÖÇøÇл»


±¾ÎÄÑÝʾÁË SQL Server 2005 ·ÖÇø±í·ÖÇøÇл»µÄÈýÖÖÐÎʽ£º
1. Çл»·ÖÇø±íµÄÒ»¸ö·ÖÇøµ½ÆÕͨÊý¾Ý±íÖУºPartition to Table£»
2. Çл»ÆÕͨ±íÊý¾Ýµ½·ÖÇø±íµÄÒ»¸ö·ÖÇøÖУºTable to Partition£»
3. Çл»·ÖÇø±íµÄ·ÖÇøµ½ÁíÒ»·ÖÇø±í£ºPartition to Partition¡£
²¢Ö¸³öÁËÔÚ·ÖÇø±í·ÖÇøÇл»¹ý³ÌÖеÄ×¢ÒâÊÂÏî¡£
-- ´´½¨·ÖÇøº¯Ê ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ