³£Óà sqlÓï¾ä
SQL²åÈëÓï¾äµÃµ½×Ô¶¯Éú³ÉµÄµÝÔö ID Öµ
insert into Table1(Name,des,num) values ('ltp','thisisbest',10);
select @@identity as 'Id'
Ëæ»úÌáÈ¡Ìõ¼Ç¼µÄÀý×Ó
SQL Server£ºSelect Top 10 * from Tablename Order By NewID()
Access£ºSelect Top 10 * from Tablename Order By Rnd(ID)
Rnd(ID) ÆäÖеÄIDÊÇ×Ô¶¯±àºÅ×ֶΣ¬¿ÉÒÔÀûÓÃÆäËûÈκÎÊýÖµÀ´Íê³É£¬±ÈÈçÓÃÐÕÃû×Ö¶ÎUserName)
Select Top 10 * from ±íOrder BY Rnd(Len(UserName))
µÃ³öijÈÕÆÚËùÔÚÔ·ݵÄ×î´óÌìÊý
ELECT DAY(DATEADD(dd, -DAY('2008-02-13'),DATEADD(mm, 1, '2008-02-13')))
AS 'DayNumber'
°´ÐÕÊϱʻÅÅÐò
Select * from TableName Order By CustomerName Collate Chinese_PRC_Stroke_ci_as
ͨÅä·ûµÄһЩÓ÷¨
1 select * from tablename where column1 like '[A-M]%'
ÕâÑù¿ÉÒÔÑ¡Ôñ³öcolumn×Ö¶ÎÖÐÊ××ÖĸÔÚA-MÖ®¼äµÄ¼Ç¼
2 select * from tablename where column1 like '[ABC]%'
ÕâÑù¿ÉÒÔÑ¡Ôñ³öcolumn×Ö¶ÎÖÐÊ××ÖĸÊÇA»òÕßB»òÕßCµÄ¼Ç¼
3 select * from tablename where column1 like '[A-CG]%'
ÕâÑù¿ÉÒÔÑ¡Ôñ³öcolumn×Ö¶ÎÖÐÊ××ÖĸÔÚA-CÖ®¼äµÄ»òÕßÊÇGµÄ¼Ç¼
4 select * from tablename where column1 like '[^C]%'
ÕâÑù¿ÉÒÔÑ¡Ôñ³öcolumn×Ö¶ÎÖÐÊ××Öĸ²»ÊÇCµÄ¼Ç¼
¸´ÖƱí½á¹¹£¨Ö»¸´Öƽṹ,Ô´±íÃû£ºa£¬Ä¿±ê±íÃû£ºb£©
select * into b from a where 1<>1
»ò
select top 0 * into [b] from [a]
Ïà¹ØÎĵµ£º
1.ÀûÓÃÏÂÃæµÄ½Å±¾´´½¨BOOK£¬READER ºÍ BORROW ±í£¬²¢Íê³ÉºóÃæµÄÁªÏµ¡£
CREATE TABLE BOOK(
NO CHAR(8) PRIMARY KEY,
TITLE VARCHAR2(50) NOT NULL,
AUTHOR VARCHAR2(20) ,
PUBLISH VARCHAR2(20),
PUB_DA ......
(1)char¡¢varchar¡¢textºÍnchar¡¢nvarchar¡¢ntext
charºÍvarcharµÄ³¤¶È¶¼ÔÚ1µ½8000Ö®¼ä£¬ËüÃǵÄÇø±ðÔÚÓÚcharÊǶ¨³¤×Ö·ûÊý¾Ý£¬¶øvarcharÊDZ䳤×Ö·ûÊý¾Ý¡£Ëùν¶¨³¤¾ÍÊdz¤¶È¹Ì¶¨ µÄ£¬µ±ÊäÈëµÄÊý¾Ý³¤¶ÈûÓдﵽָ¶¨µÄ³¤¶Èʱ½«×Ô¶¯ÒÔÓ¢ÎĿոñÔÚÆäºóÃæÌî³ä£¬Ê¹³¤¶È´ïµ½ÏàÓ¦µÄ³¤¶È£»¶ø±ä³¤×Ö·ûÊý¾ÝÔò²»»áÒÔ¿Õ¸ñÌî³ä¡£ text´ ......
Êý¾Ý¿âÉè¼Æ¾Ñé̸
Ò»¸ö³É¹¦µÄ¹ÜÀíϵͳ£¬ÊÇÓÉ£º[50% µÄÒµÎñ + 50% µÄÈí¼þ] Ëù×é³É£¬¶ø 50% µÄ³É¹¦Èí¼þÓÖÓÐ [25% µÄÊý¾Ý¿â + 25% µÄ³ÌÐò] Ëù×é³É£¬Êý¾Ý¿âÉè¼ÆµÄºÃ»µÊÇÒ»¸ö¹Ø¼ü¡£Èç¹û°ÑÆóÒµµÄÊý¾Ý±È×öÉúÃüËù±ØÐèµÄѪҺ£¬ÄÇôÊý¾Ý¿âµÄÉè¼Æ¾ÍÊÇÓ¦ÓÃÖÐ×îÖØÒªµÄÒ»²¿·Ö¡£ÓйØÊý¾Ý¿âÉè¼ÆµÄ²ÄÁϺ¹Å£³ä¶°£¬´óѧѧλ¿Î³ÌÀïÒ²ÓÐ ......
SQLServer2005ÀïʹÓÃwith encryptionÑ¡Ïî´´½¨µÄ´æ´¢¹ý³ÌÈÔÈ»ºÍsqlserver2000ÀïÒ»Ñù£¬¶¼ÊÇʹÓÃXOR½øÐÐÁ˵ļÓÃÜ¡£ºÍ2000²»Ò»ÑùµÄÊÇ£¬ÔÚ2005µÄϵͳ ±ísyscommentsÀïÒѾ²é²»µ½¼ÓÃܹýµÄÃÜÎÄÁË¡£Òª²éÃÜÎıØÐëʹÓÃDAC(רÓùÜÀíÔ±Á¬½Ó)Á¬½Óµ½Êý¾Ý¿âºó£¬ÔÚϵͳ±í sys.sysobjvalues²éѯ£¬¸Ã±íµÄÁÐimageval´æ´¢ÁËÏàÓ¦µÄÃÜÎÄ¡£¾ß ......
Ëæ×ÅB/SģʽӦÓÿª·¢µÄ·¢Õ¹£¬Ê¹ÓÃÕâÖÖģʽ±àдӦÓóÌÐòµÄ³ÌÐòÔ±Ò²Ô½À´Ô½¶à¡£µ«ÊÇÓÉÓÚÕâ¸öÐÐÒµµÄÈëÃÅÃż÷²»¸ß£¬³ÌÐòÔ±µÄˮƽ¼°¾ÑéÒ²²Î²î²»Æë£¬Ï൱´óÒ»²¿·Ö³ÌÐòÔ±ÔÚ±àд´úÂëµÄʱºò£¬Ã»ÓжÔÓû§ÊäÈëÊý¾ÝµÄºÏ·¨ÐÔ½øÐÐÅжϣ¬Ê¹Ó¦ÓóÌÐò´æÔÚ°²È«Òþ»¼¡£Óû§¿ÉÒÔÌá½»Ò»¶ÎÊý¾Ý¿â²éѯ´úÂ룬¸ù¾Ý³ÌÐò·µ»ØµÄ½á¹û£¬»ñµÃijЩËûÏëµÃÖªµÄÊ ......