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

AccessºÍSQL2000ÖÐÓï¾äµÄÇø±ð

1 £¬¶ÔÓÚÈÕÆÚ×Ö¶Î×Ö¶Î
access±íʾΪ£º#1981-28-12#
SQLSERVER2000±íʾΪ£º''1981-02-12''
2,SQLÓï¾äÇø±ð£¬select ,update ÔÚ¶Ôµ¥±í²Ù×÷ʱ¶¼²î²»¶à£¬
µ«¶à±í²Ù×÷ʱupdateÓï¾äµÄÇø±ðACCESSÓëSQLSERVERÖеÄUpdateÓï¾ä¶Ô±È:
SQLSERVERÖиüжà±íµÄUpdateÓï¾ä:
Update Tab1
SET a.Name = b.Name
from Tab1 a,Tab2 b
Where a.ID = b.ID;
ͬÑù¹¦ÄܵÄSQLÓï¾äÔÚACCESSÖÐÓ¦¸ÃÊÇ
Update Tab1 a,Tab2 b
SET a.Name = b.Name
Where a.ID = b.ID;
¼´:ACCESSÖеÄUpdateÓï¾äûÓÐfrom×Ó¾ä,ËùÓÐÒýÓÃµÄ±í¶¼ÁÐÔÚUpdate¹Ø¼ü×Öºó.
¸üе¥±íʱ£º¶¼Îª£º
Update table1 set ab='12',cd=444 where ....
3,deleteÓï¾ä
accessÖÐɾ³ýʱÓÃ:delete * from table1 where a>2 ¼´Ö»Òª°Ñselect Óï¾äÀïµÄselect »»³Édelete¾Í¿ÉÒÔÁË¡£
sqlserve ÖÐÔòΪ: delete from table1 where a>2 ¼´Ã»ÓÐ*ºÅ
4£¬as ºóÃæµÄ¼ÆËã×Ö¶ÎÇø±ð
accessÖпÉÒÔÕâÑù£ºselect a,sum(num) as kc_num,kc_num*num as all_kc_num ¼´¿ÉÒÔ°ÑASºóµÄ×ֶε±×÷Ò»¸öÊý¾Ý¿â×ֶβÎÓë¼ÆËã¡£
sqlserver ÖÐÔòΪ£ºselect a,sum(num) as kc_num,sum(num)*num as all_kc_num ¼´²»¿ÉÒÔ°ÑASºóµÄ×ֶε±×÷Ò»¸öÊý¾Ý¿â×ֶβÎÓë¼ÆËã¡£
5£¬[.]Óë[!]µÄÇø±ð
accessÖжà±íÁªºÏ²éѯʱ£ºselect tab1!a as tab1a,tab2!b tab2b from tab1,tab2 ,ÖмäµÄAS¿ÉÒÔ²»Òª¡£
¡¡sqlserve ÖÐÔò£ºselect tab1.a as tab1a,tab2.b tab2b from tab1,tab2 ,ÖмäµÄAS¿ÉÒÔ²»Òª¡£
6,ÁªºÏ²éѯʱ£¬
¡¡¡¡ accessÖжà±íÁªºÏ²éѯ:'select a,b from(
select a,b from tab1 where a>3 union select c,d from tab2 ) group by a,b
sqlserve ÖÐÔò'select a,b from(
select a,b from tab1 where a>3 union select c,d from tab2 ) tmptable group by a,b¼´Òª¼ÓÒ»¸öÐéµÄ±ítmptable£¬±íÃûÈÎÒâ¡£---
7£¬accessÉý¼¶µ½sqlserverʱ£¬
¡¡¡¡¿ÉÒÔÓÃsqlserverµÄÊý¾Ýµ¼È빤¾ßµ¼ÈëÊý¾Ý£¬µ«Òª×ö±ØÒªµÄ´¦Àí¡£
¡¡¡¡accessÖеÄ×Ô¶¯±àºÅ£¬²»»á×Ô¶¯×ª»»SQLÖеÄ×Ô¶¯±àºÅ£¬Ö»ÄÜת»»ÎªintÐÍ£¬Òª°ÑËüÊÖ¹¤¸Ä³É±êʶ×ֶΣ¬ÖÖ×ÓΪ1£¬°ÑËùÓе¼Èë±»sqlserverת»¯³ÉµÄÒÔn¿ªÍ·µÄ×Ö¶ÎÀàÐ͵ÄnÈ¥µô£¬Èçnvarchar->varchar.°ÑÐèÒªÓÐÃëÀàÐ͵ÄÈÕÆÚ×ֶθijÉdatatimeÀàÐÍ£¨SQL»á°ÑËùÓеÄÈÕÆÚ¿ª×ª»¯³ÉsmalldatetimeÐÍ£©
8,trueÓë1=1
accessÓÃwhere true±íʾÌõ¼þΪÕæ,
sqlserverÓÃwhere 1=1±íʾÌõ¼þΪÕæ
9,ÅжÏ×Ö¶ÎֵΪ¿ÕµÄÇø±ð
ÆÕͨ¿Õ£º
AccessºÍsql serverÒ»Ñù where co


Ïà¹ØÎĵµ£º

SQL³£ÓÃÓï¾ä

1¡¢Óëgroup by´îÅäʹÓõĺ¯Êý
ÔÚÊý¾Ý¿âÖУ¬ÎÒÃÇ¿ÉÒÔʹÓÃGROUP BYº¯Êý°ÑÊý¾Ý×éºÏÔÚÒ»Æ𣬴Ӷø»ñµÃ×ܼÆÐÅÏ¢¡£¿ÉÒ԰Ѵ˹¦ÄÜ¿´³ÉÊÇÒ»ÖÖµ±Êý¾Ý´ÓÊý¾Ý¿âÖзµ»Øʱ°ÑÏàͬÀàÐ͵ÄÐÅÏ¢¼¯Öе½Ò»ÆðµÄÄÜÁ¦¡£ÏÂÃæ¸ø³öÁËÍêÕûÁÐ±í¡£
avg([distinct]column_name)
ÇóËùÓйÍԱнˮµÄƽ¾ùÖµ¡£
select AVG(emp_salary)
from employee;
ÇóÈ¡c ......

Sql µãµÎ

ID int identity(1,1) primary key ×Ô¶¯Ôö³¤,Ö÷¼ü
EXEC sp_rename 'login_info','PDI_login_info'  Ö´Ðд洢¹ý³Ì sp_rename , ½«login_info±íÃû ¸ü¸ÄΪ PDI_login_info
SET   XACT_ABORT  {ON|OFF} Èç¹ûÊÂÎñÖз¢Éú´íÎó£¬on   Ôò»áÖÕÖ¹Õû¸öÊÂÎñµÄÖ´ÐУ¬Èç¹ûOFF£¬¼ÌÐø´íÎóµÄÏÂÃæÒ»¾ä  
SET &nbs ......

MySQL ×Ö·û¼¯µ¼ÖÂSQLÁ¬½ÓÖ®ºóÖÐÎÄÂÒÂëµÄÎÊÌ⣡

character-set-server = GB2312
collation-server = latin1_general_ci
MySQL×Ö·û¼¯ GBK¡¢GB2312¡¢UTF8Çø±ð ½â¾ö MYSQLÖÐÎÄÂÒÂëÎÊÌâ ÊÕ²Ø
MySQLÖÐÉæ¼°µÄ¼¸¸ö×Ö·û¼¯
character-set-server/default-character-set£º·þÎñÆ÷×Ö·û¼¯£¬Ä¬ÈÏÇé¿öÏÂËù²ÉÓõġ£
character-set-database£ºÊý¾Ý¿â×Ö·û¼¯¡£
character-set-table£ºÊ ......

Access ·ÖÒ³²éѯ

   ×Ô¼º×öµÄÒ»¸ö.net´íÎóÊÕ¼¯£¬ÊÕ¼¯ÕûÕ¾µÄ500´íÎó£¬ÓõÄaccessÊý¾Ý¿â¡£Êý¾Ý¹ý20000ºó£¬Ê¹Óô«Í³µÄSELECT TOP 10 * from TABLE WHERE ID NOT IN(SELECT TOP 10*10 * from TABLE)²éѯ¾¹È»ÒªºÃ¼¸·ÖÖÓ£¬º¹~~~~£¡
   ÍøÉϲ鵽µÄÒ»ÌõÓï¾ä»¹²»´í¡£
    SELECT TOP 10 id,Message,CreateTime ......

ÓÃVFPÁгöACCESSËùÓбíµÄ×ֶνṹ£¬º¬±êÌâ¡£

     set safety off
     local oo,lcStr,lcMdbFile,i,x,lnFields,lcTableName,lnFieldtype,lcCurdir
     lcCurdir = sys(5) + curdir()
     lcNowdir = getdir()
     cd (lcNowdir)
   &nb ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ