Access(jet sql)ÓëMS SQL Server(t
ÍøÉÏËѼ¯£¬±¸ÓÃ
ϱíÁгöÁË ANSI SQL Êý¾ÝÀàÐͺ͵ÈЧµÄ Microsoft Jet Êý¾Ý¿âÒýÇæ SQLÊý¾ÝÀàÐÍ»¹ÓÐËüÃǵÄÓÐЧͬÒå×ÖÒÔ¼° µÈЧµÄ Microsoft SQL ServerÊý¾ÝÀàÐÍ¡£
ANSI SQL
Êý¾ÝÀàÐÍ
Microsoft Access
SQL Êý¾ÝÀàÐÍ
ͬÒå´Ê
Microsoft SQL
Server Êý¾ÝÀàÐÍ
BIT¡¢BIT VARYING
BINARY£¨²Î¼û×¢ÊÍ£©
VARBINARY¡¢
BINARY VARYING
BIT VARYING
BINARY¡¢VARBINARY
²»Ö§³Ö
BIT£¨²Î¼û×¢ÊÍ£©
BOOLEAN¡¢LOGICAL¡¢LOGICAL1¡¢YESNO
BIT
²»Ö§³Ö
TINYINT
INTEGER1¡¢BYTE
TINYINT
²»Ö§³Ö
COUNTER£¨²Î¼û×¢ÊÍ£©
AUTOINCREMENT
£¨²Î¼û×¢ÊÍ£©
²»Ö§³Ö
MONEY
CURRENCY
MONEY
DATE¡¢TIME¡¢TIMESTAMP
DATETIME
DATE¡¢TIME£¨²Î¼û×¢ÊÍ£©
DATETIME
²»Ö§³Ö
UNIQUEIDENTIFIER
GUID
UNIQUEIDENTIFIER
DECIMAL
DECIMAL
NUMERIC¡¢DEC
DECIMAL
REAL
REAL
SINGLE¡¢FLOAT4¡¢IEEESINGLE
REAL
DOUBLE PRECISION¡¢FLOAT
FLOAT
DOUBLE¡¢FLOAT8¡¢IEEEDOUBLE¡¢NUMBER£¨²Î¼û×¢ÊÍ£©
FLOAT
SMALLINT
SMALLINT
SHORT¡¢INTEGER2
SMALLINT
INTEGER
INTEGER
LONG¡¢INT¡¢INTEGER4
INTEGER
INTERVAL
²»Ö§³Ö
²»Ö§³Ö
²»Ö§³Ö
IMAGE
LONGBINARY¡¢GENERAL¡¢OLEOBJECT
IMAGE
²»Ö§³Ö
TEXT£¨²Î¼û×¢ÊÍ£©
LONGTEXT¡¢LONGCHAR¡¢MEMO¡¢NOTE¡¢NTEXT£¨²Î¼û×¢ÊÍ£©
TEXT
CHARACTER¡¢CHARACTER VARYING¡¢NATIONAL CHARACTER¡¢NATIONAL CHARACTER VARYING
CHAR£¨²Î¼û×¢ÊÍ£©
TEXT(n)¡¢ALPHANUMERIC¡¢CHARACTER¡¢STRING¡¢VARCHAR¡¢CHARACTER VARYING¡¢NCHAR¡¢NATIONAL CHARACTER¡¢NATIONAL CHAR¡¢NATIONAL CHARACTER VARYING¡¢NATIONAL CHAR VARYING£¨²Î¼û×¢ÊÍ£©
CHAR¡¢VARCHAR¡¢NCHAR¡¢NVARCHAR
×¢ÊÍ
ANSI SQL BIT Êý¾ÝÀàÐͲ»¶ÔÓ¦ÓÚ Microsoft Access SQL BIT Êý¾ÝÀàÐÍ£¬¶øÊǶÔÓ¦ÓÚ BINARY Êý¾ÝÀàÐÍ¡£Microsoft Access SQL BIT Êý¾ÝÀàÐÍûÓеÈЧµÄ ANSI SQL Êý¾ÝÀàÐÍ¡£
²»ÔÙÖ§³Ö TIMESTAMP ×÷Ϊ DATETIME µÄͬÒå´Ê¡£
²»ÔÙÖ§³Ö NUMERIC ×÷Ϊ FLOAT »ò DOUBLE µÄͬÒå´Ê¡£NUMERIC ÏÖÔÚÓÃ×÷ DECIMAL µÄͬÒå´Ê¡£
LONGTEXT ×Ö¶ÎʼÖÕÒÔ Unicode £¨Unicode£ºUnicode Consortium ¿ª·¢µÄÒ»ÖÖ×Ö·û±àÂë±ê×¼¡£¸Ã±ê×¼²ÉÓöࣨÓÚÒ»£©¸ö×Ö½Ú´ú±íÿһ×Ö·û£¬ÊµÏÖÁËʹÓõ¥¸ö×Ö·û¼¯´ú±íÊÀ½çÉϼ¸ºõËùÓÐÊéÃæÓïÑÔ¡££© ±íʾÐÎʽ´æ´¢¡£
Èç¹ûÔÚδָ¶¨¿ÉÑ¡³¤¶ÈµÄÇé¿öÏÂʹÓÃÊý¾ÝÀàÐÍÃû³Æ TEXT£¬Ôò´´½¨ LONGTEXT ×ֶΡ£ÕâÑù£¬±àдµÄ
Ïà¹ØÎĵµ£º
MySQL·þÎñÆ÷°üº¬Ò»Ð©ÆäËûSQL DBMSÖв»¾ß±¸µÄÀ©Õ¹¡£×¢Ò⣬Èç¹ûʹÓÃÁËËüÃÇ£¬½«ÎÞ·¨°Ñ´úÂëÒÆÖ²µ½ÆäËûSQL·þÎñÆ÷¡£ÔÚijЩÇé¿öÏ£¬Äã¿ÉÒÔ±àд°üº¬MySQLÀ©Õ¹µÄ´úÂ룬µ«ÈÔ±£³ÖÆä¿ÉÒÆÖ²ÐÔ£¬·½·¨ÊÇÓÓ/*... */”×¢Ê͵ôÕâЩÀ©Õ¹¡£MySQL·þÎñÆ÷Äܹ»½âÎö²¢Ö´ÐÐ×¢ÊÍÖеĴúÂ룬¾ÍÏñ¶Ô´ýÆäËûMySQLÓï¾äÒ»Ñù£¬µ«ÆäËûSQL·þÎñÆ÷½«ºöÂÔ ......
ÕâÁ½Ììдһ¸öºÍͳ¼ÆÊý¾ÝÓйصĴ洢¹ý³Ì£¬ÀïÃæÒªÀûÓÃÈÕÆÚ½øÐÐһЩ¼ÆËãºÍÅжϣ¬Ò²×ÔȻҪÀûÓÃSQLµÄһЩÈÕÆÚÏà¹ØµÄº¯Êý¡£ÕâÀïÂÔ¼Çһϣ¬µ±ÊǸ´Ï°Ò»ÏÂSQL¡£
ÀûÓÃSQL½Å±¾ÄÚÖõļ¸¸öº¯Êý£¬ÎÒÃÇÄÜÁé»îµÄ¶ÔÈÕÆÚ½øÐмÆËãºÍ±È½Ï¡£³£Óõļ¸¸öº¯Êý£ºGETDATE(),DATEDIFF(),DATEADD()
GETDATE() µ±È»¹ËÃû˼Ò壬µÃµ½µ±Ç°µÄÈÕÆÚ£¬·µ»ØÀàÐÍÊ ......
¡¡1. ²é¿´Êý¾Ý¿âµÄ°æ±¾
¡¡¡¡select @@version
¡¡¡¡³£¼ûµÄ¼¸ÖÖSQL SERVER´ò²¹¶¡ºóµÄ°æ±¾ºÅ:
¡¡¡¡8.00.194 Microsoft SQL Server 2000
¡¡¡¡8.00.384 Microsoft SQL Server 2000 SP1
¡¡¡¡8.00.532 Microsoft SQL Server 2000 SP2
¡¡¡¡8.00.760 Microsoft SQL Server 2000 SP3
¡¡¡¡8.00.818 Microsoft SQL ......
cdateÊÇdatetimeÀàÐ͵Ä×Ö¶Î
ͳ¼ÆÒ»ÄêµÄÈçÏÂ
select datepart(yy,cdate) as 'Ô·Ý',sum(cmoney) from consumption group by datepart(yy,cdate)
ͳ¼ÆÒ»ÔµÄÈçÏÂ
select datepart(mm,cdate) as 'Ô·Ý',sum(cmoney) from consumption where datepart(yy,cdate)=2009 group by datepart(mm,cdate)
ͳ¼ÆÒ»ÖÜ ......