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

SQLÖÐconvertµÄÓ÷¨


À´Ô´£ºhttp://www.cnblogs.com/jxnuxg/articles/1114418.html
CONVERT(data_type,expression[,style])
Óï¾ä¼°²éѯ½á¹û£º
SELECT CONVERT(varchar(100), GETDATE(), 0): 05 16 2006 10:57AM
SELECT CONVERT(varchar(100), GETDATE(), 1): 05/16/06
SELECT CONVERT(varchar(100), GETDATE(), 2): 06.05.16
SELECT CONVERT(varchar(100), GETDATE(), 3): 16/05/06
SELECT CONVERT(varchar(100), GETDATE(), 4): 16.05.06
SELECT CONVERT(varchar(100), GETDATE(), 5): 16-05-06
SELECT CONVERT(varchar(100), GETDATE(), 6): 16 05 06
SELECT CONVERT(varchar(100), GETDATE(), 7): 05 16, 06
SELECT CONVERT(varchar(100), GETDATE(), 8): 10:57:46
SELECT CONVERT(varchar(100), GETDATE(), 9): 05 16 2006 10:57:46:827AM
SELECT CONVERT(varchar(100), GETDATE(), 10): 05-16-06
SELECT CONVERT(varchar(100), GETDATE(), 11): 06/05/16
SELECT CONVERT(varchar(100), GETDATE(), 12): 060516
SELECT CONVERT(varchar(100), GETDATE(), 13): 16 05 2006 10:57:46:937
SELECT CONVERT(varchar(100), GETDATE(), 14): 10:57:46:967
SELECT CONVERT(varchar(100), GETDATE(), 20): 2006-05-16 10:57:47
SELECT CONVERT(varchar(100), GETDATE(), 21): 2006-05-16 10:57:47.157
SELECT CONVERT(varchar(100), GETDATE(), 22): 05/16/06 10:57:47 AM
SELECT CONVERT(varchar(100), GETDATE(), 23): 2006-05-16
SELECT CONVERT(varchar(100), GETDATE(), 24): 10:57:47
SELECT CONVERT(varchar(100), GETDATE(), 25): 2006-05-16 10:57:47.250
SELECT CONVERT(varchar(100), GETDATE(), 100): 05 16 2006 10:57AM
SELECT CONVERT(varchar(100), GETDATE(), 101): 05/16/2006
SELECT CONVERT(varchar(100), GETDATE(), 102): 2006.05.16
SELECT CONVERT(varchar(100), GETDATE(), 103): 16/05/2006
SELECT CONVERT(varchar(100), GETDATE(), 104): 16.05.2006
SELECT CONVERT(varchar(100), GETDATE(), 105): 16-05-2006
SELECT CONVERT(varchar(100), GETDATE(), 106): 16 05 2006
SELECT CONVERT(varchar(100), GETDATE(), 107): 05 16, 2006
SELECT CONVERT(varchar(100), GETDATE(), 108): 10:57:49
SELECT CONVERT(varchar(100), GETDATE(), 109): 05 16 2006 10:57:49:437AM
SELECT CONVERT(varchar(100), GETDA


Ïà¹ØÎĵµ£º

SQL 2005 °²×°

ÏÂÔØsql2005ÍêÒÔºó½âѹ³öÀ´£¬´ó¼Ò¿ÉÒÔ¿´µ½cs_sql_2005_chs_x86Õâ¸öĿ¼£¬½øÈëÕâ¸öĿ¼ÔËÐÐsetup.exeÎļþ£¬°²×°³ÌÐò¾Í¿ªÊ¼ÔËÐÐÁË¡£
Ê×Ïȵ¯³öÀ´µÄÊÇÈí¼þÐí¿ÉÌõ¿î
¹´ÉÏÎÒ½Ó°®Ðí¿ÉÌõ¿îºÍÌõ¼þ£¬µãÏÂÒ»²½
ÕâÀïÁгöÁËSQL2005ÔËÐл·¾³£¬Ö±½Óµã°²×°
³ÌÐò¿ªÊ¼°²×°SQL2005ÔËÐбØÐèµÄ»·¾³£¬ÅäÖÃ×é¼þ
±ØÐèµÄ×é¼þ°²×°ºÃÁË£¬µãÏÂÒ»²½¼ ......

SQL Server 2005 ·þÎñÆ÷½ÇÉ«ºÍÊý¾Ý¿â½ÇÉ«ÃûÈ«½â

SQL Server 2005 ·þÎñÆ÷½ÇÉ«ºÍÊý¾Ý¿â½ÇÉ«ÃûÈ«½â
/*·þÎñÆ÷½ÇÉ«*/
sysadmin
--ÔÚ SQL Server ÖнøÐÐÈκλ¡£¸Ã½ÇÉ«µÄȨÏÞ¿çÔ½ËùÓÐÆäËü¹Ì¶¨·þÎñÆ÷½ÇÉ«¡£
serveradmin
--ÅäÖ÷þÎñÆ÷·¶Î§µÄÉèÖá£
setupadmin
--Ìí¼ÓºÍɾ³ýÁ´½Ó·þÎñÆ÷£¬²¢Ö´ÐÐijЩϵͳ´æ´¢¹ý³Ì£¨Èç sp_serveroption£©¡£
securityadmin
--¹ÜÀí·þÎñÆ÷ ......

SQL ServerÈÕÖ¾Çå¿Õ·½·¨

תÔØ£ºhttp://blog.csdn.net/cnming/archive/2009/03/11/3979290.aspx
ÔÚ²éѯ·ÖÎöÆ÷ÖÐ˳ÐòÖ´ÐÐÒÔÏÂÈý²½£¬ÆäÖР  databasename   ΪÄãµÄÊý¾Ý¿âÎļþÃû
1.Çå¿ÕÈÕÖ¾£ºDUMP   TRANSACTION   databasename   WITH   NO_LOG  
2.½Ø¶ÏÊÂÎñÈÕÖ¾£ºBACKUP ......

sqlÓï¾äµÄÖ´ÐÐ˳ÐòʵÀý½²½â


±ê׼˳ÐòµÄ SQL Óï¾äΪ: 
Select ¿¼ÉúÐÕÃû, max(×ܳɼ¨) as max×ܳɼ¨ 
from tb_Grade 
where ¿¼ÉúÐÕÃû is not null 
group by ¿¼ÉúÐÕÃû 
having max(×ܳɼ¨) > 600 
order by max×ܳɼ¨ 
ÔÚÉÏÃæµÄʾÀýÖÐ SQL Óï¾äµÄÖ´ÐÐ˳ÐòÈçÏÂ: 
(1). Ê×ÏÈÖ´ÐÐ from ×Ó¾ä, ´Ó tb_G ......

SQLÖÐONºÍWHEREÌõ¼þµÄÇø±ð

Êý¾Ý¿âÔÚͨ¹ýÁ¬½ÓÁ½ÕÅ»ò¶àÕűíÀ´·µ»Ø¼Ç¼ʱ£¬¶¼»áÉú³ÉÒ»ÕÅÖмäµÄÁÙʱ±í£¬È»ºóÔÙ½«ÕâÕÅÁÙʱ±í·µ»Ø¸øÓû§¡£
ÔÚʹÓÃleft jionʱ£¬onºÍwhereÌõ¼þµÄÇø±ðÈçÏ£º
1¡¢onÌõ¼þÊÇÔÚÉú³ÉÁÙʱ±íʱʹÓõÄÌõ¼þ£¬Ëü²»¹ÜonÖеÄÌõ¼þÊÇ·ñΪÕ棬¶¼»á·µ»Ø×ó±ß±íÖеļǼ¡£
2¡¢whereÌõ¼þÊÇÔÚÁÙʱ±íÉú³ÉºÃºó£¬ÔÙ¶ÔÁÙʱ±í½øÐйýÂ˵ÄÌõ¼þ¡£ÕâʱÒÑ ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ