MySqlµÄ¼òµ¥Ð޸ıí×Ö¶ÎSQLÓï¾ä
#ÐÂÔöÒ»¸ö×ֶΣ¬Ä¬ÈÏֵΪ0£¬·Ç¿Õ£¬×Ô¶¯Ôö³¤£¬Ö÷¼ü
alter table tabelname add new_field_name field_type default 0 not null auto_increment ,add primary key (new_field_name);
#Ôö¼ÓÒ»¸öÐÂ×Ö¶Î
alter table tableName add new_field_name field_type;
alter table tableName add new_field_name field_type not null default '0';
#ɾ³ý×Ö¶Î
alter table tableName drop column field_name;
#ÖØÃüÃû×Ö¶Î
alter table tableName change old_field_name new_field_name new_field_type;
#¸Ä±ä×ֶεÄÀàÐÍ
alter table tableName change field_name field_name field_type;
#ÖØÃüÃû±í
alter table table_old_name rename table_new_name;
#¼ÓË÷Òý
alter table tablename add index Ë÷ÒýÃû (×Ö¶ÎÃû1[£¬×Ö¶ÎÃû2 …]);
alter table tablename add index index_name(name);
#ÉèÖÃÖ÷¼ü
alter table tablename add primary key(field_name);
#Ìí¼ÓΨһË÷Òý
alter table tablename add unique index_name(field_name);
#ɾ³ýË÷Òý
alter table tablename drop index index_name;
Ïà¹ØÎĵµ£º
ÏÂÁÐÓï¾ä²¿·ÖÊÇMssqlÓï¾ä£¬²»¿ÉÒÔÔÚaccessÖÐʹÓá£
SQL·ÖÀࣺ
DDL—Êý¾Ý¶¨ÒåÓïÑÔ(CREATE£¬ALTER£¬DROP£¬DECLARE)
DML—Êý¾Ý²Ù×ÝÓïÑÔ(SELECT£¬DELETE£¬UPDATE£¬INSERT)
DCL—Êý¾Ý¿ØÖÆÓïÑÔ(GRANT£¬REVOKE£¬COMMIT£ ......
mysqlÖÐINSTRº¯ÊýµÄÓ÷¨
INSTR(×Ö¶ÎÃû, ×Ö·û´®)
Õâ¸öº¯Êý·µ»Ø×Ö·û´®ÔÚijһ¸ö×ֶεÄÄÚÈÝÖеÄλÖÃ, ûÓÐÕÒµ½×Ö·û´®·µ»Ø0£¬·ñÔò·µ»ØÎ»Ö㨴Ó1¿ªÊ¼£©
SELECT * from tblTopic ORDER BY INSTR( topicTitle, 'ha' ) > 0 DESC
SELECT INSTR( topicTitle, 'ha' ) from tblTopic
mysqlÖÐʹÓÃinstrÅäºÏINÅÅÐò
½«instr½á¹û×÷Î ......
Unixʱ¼ä´Á×îСµ¥Î»ÊÇÃ룬¿ªÊ¼Ê±¼äΪ¸ñÁÖÍþÖαê׼ʱ¼ä1970-01-01 00:00:00
ConvertIntDateTime·½·¨µÄ»ù±¾Ë¼Â·ÊÇͨ¹ý»ñÈ¡±¾µØÊ±Çø±íʾUnixk¿ªÊ¼Ê±¼ä£¬¼ÓÉÏUnixʱ¼äÖµ£¨¼´¹ýÈ¥µÄÃëÊý£©.
ConvertDateTimeInt·½·¨µÄ»ù±¾Ë¼Â·ÊÇͨ¹ý¿Ì¶ÈÊý²î£¬Ôٰѿ̶ÈÊýת»»ÎªÃëÊý£¬µ±È»ÒªËµÃ÷µÄÊÇ£¬ÎÒÕâÀï·µ»ØµÄÊÇdoubleÀàÐÍ£¬ÒâÒåÉϲ¢·ÇÊÇÕæ ......
´´½¨ºÍÅäÖÃASP.NET Session״̬Êý¾Ý¿â
ÔÚ»ùÓÚNLB£¨ÍøÂç¸ºÔØÆ½ºâ£©»·¾³ÏµÄASP.NET WebÓ¦ÓóÌÐò¿ª·¢£¬ÎÒÃÇÐèÒª½«Session´æ´¢ÔÚÊý¾Ý¿âÖй©¶à¸öWebÓ¦ÓóÌÐòµ÷Óã¬ÒÔÏÂΪÅäÖ÷½·¨¼°×¢ÒâÊÂÏî¡£
1.´´½¨ÓÃÓÚ´æ´¢ASP.NET SessionµÄÊý¾Ý¿â£¨Ô¶³Ì¡¢±¾µØ½Ô¿É£¬Ê¹ÓÃÊý¾Ý¿âÓû§Éí·ÝÈÏÖ¤£©
ÔÚWindows\Microsoft.NET\Framework/V2.0.507 ......
declare @p int
declare @p1 int
declare @count int
set @p=0
set @p1=10
set @count=2
if(@count<>0 or @count<>1)
set @p=@p1*@count-10
SELECT [t1].[userid], [t1].[username], [t1].[userorder]
from (
SELECT ROW_NUMBER() OVER (ORDER BY [t0].[userorder]) AS [ROW_NU ......