SQLServerÖÐDatetimeÀàÐÍÊý¾ÝµÄ±È½Ï
SQLServerÖÐDatetimeÀàÐÍÊý¾ÝµÄ±È½Ï
2009Äê02ÔÂ20ÈÕ ÐÇÆÚÎå 16:40
/* ¶¨Ò忪ʼÈÕÆںͽáÊøÈÕÆÚ*/
declare @date_a datetime,@date_b datetime
set @date_a='2009-2-10'
set @date_b='2009-2-12'
/* ÔÚÈÕÆÚdate_a(°üº¬) ºÍdate_b(²»°üº¬) Ö®¼ä*/
select * from ut_article where createtime between @date_a and @date_b
/* ÔÚÈÕÆÚdate_a(²»°üº¬) ºÍdate_b(°üº¬) Ö®¼ä*/
select * from ut_article where datediff(d,@date_a,createtime)>0 and datediff(d,@date_b,createtime)<=0
/* ÔÚÈÕÆÚdate_a(²»°üº¬) ºÍdate_b(²»°üº¬) Ö®¼ä*/
select * from ut_article where datediff(d,@date_a,createtime)>0 and datediff(d,@date_b,createtime)<0
/* ÔÚÈÕÆÚdate_a(°üº¬) ºÍdate_b(°üº¬) Ö®¼ä*/
select * from ut_article where datediff(d,@date_a,createtime)>=0 and datediff(d,@date_b,createtime)<=0
Ïà¹ØÎĵµ£º
ÒÔÇ°¾³£Óöµ½Êý¾Ý¿âÈÕÖ¾ÎļþËð»µ,»òÕ߶ªÊ§µÄÇé¿ö,½ñÌ콫½â¾ö·½°¸Ð´ÏÂÀ´,ÒÔºó±ðÈËÔÙÎÊÆð¾Í¸øËû¸öÁ´½Ó,¶à·½±ã°¡.
ºÇºÇ:
1.н¨Ò»¸öͬÃûµÄÊý¾Ý¿â
2.ÔÙÍ£µôsql server(×¢Òâ²»Òª·ÖÀëÊý¾Ý¿â)
3.ÓÃÒª¸½¼ÓµÄÊý¾ÝÎļþ¸²¸ÇµôÕâ¸öн¨µÄÊý¾Ý¿â
4.ÔÙÖØÆôsql server
5.´Ëʱ´ò¿ªÆóÒµ¹ÜÀíÆ÷ʱ»á³öÏÖÖÃÒÉ£¬ÏȲ»¹Ü£¬Ö´ÐÐÏÂÃæµÄÓï¾ä£¨×¢ ......
ÒÔ³¬¼¶¹ÜÀíÔ±µÇ¼ϵͳ£¬È»ºóÖ´ÐÐÒÔϽű¾¾Í¿ÉÒÔÅúÁ¿Ð޸ĶÔÏóËùÓÐÕß¡£
sp_configure 'allow updates','1'
go
reconfigure with override
go
update sysobjects set uid=1 where uid<>1
go
sp_configure 'allow updates','0'
go
reconfigure with override ......
Mysql£¬SqlServer£¬OracleÖ÷¼ü×Ô¶¯Ôö³¤µÄÉèÖÃ
1¡¢°ÑÖ÷¼ü¶¨ÒåΪ×Ô¶¯Ôö³¤±êʶ·ûÀàÐÍ
ÔÚmysqlÖУ¬Èç¹û°Ñ±íµÄÖ÷¼üÉèΪauto_incrementÀàÐÍ£¬Êý¾Ý¿â¾Í»á×Ô¶¯ÎªÖ÷¼ü¸³Öµ¡£ÀýÈ磺
create table customers(id int auto_increment primary key not null, name varchar(15));
insert into customers(name) values("name1"),("nam ......
>>mysql:
1¡¢²é¿´ËùÓбíÃû£º
show tables [from db_name];
2¡¢²é¿´×Ö¶ÎÐÅÏ¢
SHOW FULL COLUMNS from db_name.table_name
»ñÈ¡ÒÔÏÂÐÅÏ¢
Field £º×Ö¶ÎÃû
Type£º×Ö¶ÎÀàÐÍ
Collation£º×Ö·û¼¯ £¨mysql 5.0ÒÔÉÏÓУ©
Null £ºÊÇ·ñ¿ÉÒÔΪNULL
Key£ºË÷Òý£¨PRI,unique,index)
Default£ºÈ±Ê¡Öµ
Extra£º¶îÍ⣨ÊÇ·ñ aut ......
mysql ´ó¶ÔÏó´æÈ¡:
ÀàÐÍÒ»°ãÓ¦¸ÃÓÃmediumblod,
blobÖ»ÄÜ´æ2µÄ16´Î·½¸öbyte,
mediumblodÊÇ24´Î·½,
Ò»°ãÀ´Ëµ¹»ÓÃÁË.longblobÊÇ32´Î·½ÓÐЩ´ó.
MYSQLĬÈÏÅäÖÃÖ»ÄÜ´æ1M´óСµÄÎļþ,ÒªÐÞ¸ÄÅäÖÃ,WIN°æ±¾µÄÔÚmysql.iniÎļþÖÐ
ÐÞ¸Ämax_allowed_packet,net_buffer_lengthµÈ¼¸¸ö²ÎÊý,»òÖ±½ÓSET GLOBAL varName=value.
linux°æ± ......