SQL ³£ÓÃµÄ Ôö¡¢É¾¡¢¸Ä¡¢²é »¹ÊÇÀμÇÓÚÐÄ àÞ
¼¸¸ö¼òµ¥µÄ»ù±¾µÄsqlÓï¾ä
Ñ¡Ôñ£ºselect * from table1 where ·¶Î§
²åÈ룺insert into table1(field1,field2) values(value1,value2)
ɾ³ý£ºdelete from table1 where ·¶Î§
¸üУºupdate table1 set field1=value1 where ·¶Î§
²éÕÒ£ºselect * from table1 where field1 like ’%value1%’
ÅÅÐò£ºselect * from table1 order by field1,field2 [desc]
×ÜÊý£ºselect count ( *) as totalcount from table1
ÇóºÍ£ºselect sum(field1) as sumvalue from table1
ƽ¾ù£ºselect avg(field1) as avgvalue from table1
×î´ó£ºselect max(field1) as maxvalue from table1
×îС£ºselect min(field1) as minvalue from table1
³õѧÕß±ØÐëÕÆÎÕµÎ
Ïà¹ØÎĵµ£º
½ñÌìÓÃtime Like '2008-06-01%'Óï¾äÀ´²éѯ¸ÃÌìµÄËùÓÐÊý¾Ý£¬±»ÌáʾÓï¾ä´íÎó¡£²éÁËһϲŷ¢ÏÖ¸ÃÄ£ºý²éѯֻÄÜÓÃÓÚStringÀàÐ͵Ä×ֶΡ£
×Ô¼ºÒ²²éÔÄÁËһЩ×ÊÁÏ¡£¹ØÓÚʱ¼äµÄÄ£ºý²éѯÓÐÒÔÏÂÈýÖÖ·½·¨£º
1.Convertת³ÉString,ÔÚÓÃLike²éѯ¡£
select * from table1 where c ......
ʹÓÃSQL SERVER2005µÄʱºòÓöµ½ÁËÖÐÎÄ×Ö·ûΪÂÒÂëµÄÇé¿ö£¬¾¹ýÑо¿·¢ÏÖ£¬ÉèÖÃSQLµÄÅÅÐò¹æÔò¿ÉÒÔ½â¾öÕâ¸öÎÊÌâ¡£
1¡¢µÇ¼·þÎñÆ÷´ò¿ªMicrosoft SQL Server Management Studio¡£
2¡¢ÔÚÒªÐ޸ĵÄÊý¾Ý¿âÉϵ¥»÷Êó±êÓÒ¼ü£¬²¢Ñ¡Ôñ“ÊôÐÔ”¡£
3¡¢ÔÚµ¯³öµÄÊý¾Ý¿âÊôÐÔ´°¿ÚÖеã»÷“Ñ¡ÔñÒ³”ÖеēѡÏ£ ......
Æô¶¯Êý¾Ý¿âÓʼþ¹¦ÄÜ
sp_configure 'show advanced', 1;
GO
RECONFIGURE;
GO
sp_configure 'Database Mail XPs', 1;
GO
RECONFIGURE;
GO
-- ÅäÖÃÊý¾Ý¿âÓʼþ
-- Ìí¼ÓÓʼþÕË»§
execute msdb.dbo.sysmail_add_account_sp
@account_name = 'ÓÊÏäÕ ......
Êý¾Ý¿âÖеÄËùÓÐÊý¾Ý´æ´¢ÔÚ±íÖС£Êý¾Ý±í°üÀ¨ÐкÍÁС£Áоö¶¨Á˱íÖÐÊý¾ÝµÄÀàÐÍ¡£Ðаüº¬ÁËʵ¼ÊµÄÊý¾Ý¡£
ÀýÈ磬Êý¾Ý¿âpubsÖеıíauthorsÓоŸö×ֶΡ£ÆäÖеÄÒ»¸ö×Ö¶ÎÃûΪΪau_lname£¬Õâ¸ö×ֶα»ÓÃÀ´´æ´¢×÷ÕßµÄÃû×ÖÐÅÏ¢¡£Ã¿´ÎÏòÕâ¸ö±íÖÐÌí¼ÓÐÂ×÷Õßʱ£¬×÷ÕßÃû×־ͱ»Ìí¼Óµ½Õâ¸ö×ֶΣ¬²úÉúÒ»ÌõмǼ¡£
ͨ¹ý¶¨Òå×ֶ䪎 ......
SELECT SERVERPROPERTY('productversion'), SERVERPROPERTY ('productlevel'), SERVERPROPERTY ('edition')
productversion£º²úÆ·°æ±¾£¨ÀýÈ磬10.0.1600.22£©
productlevel£º²úÆ·¼¶±ð£¨ÀýÈ磬RTM£©
edition£º°æ±¾£¨ÀýÈ磬 Enterprise£¨ÆóÒµ°æ£©¡¢Developer Edition£¨¿ª·¢°æ£©£©
SELECT @@VERSION
΢Èí¾ßÌå˵Ã÷£º
......