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

sqlÖлñµÃ²¿·Öʱ¼äµÄ·½·¨

ºÜ¶àʱºò£¬ÎÒÃÇ¿ÉÄÜÏ£Íû°´Ô¡¢°´Ìì¡¢°´Äê×öһЩÊý¾Ýͳ¼Æ£¬µ«ÊÇ£¬ÎÒÃÇʵ¼Ê±£´æµÄÊý¾Ý¿ÉÄÜÊÇÒ»¸öºÜ¾«È·µÄ·¢Éúʱ¼ä£¬¿ÉÄÜÊǵ½Ãë¡£ÈçºÎ¸ù¾ÝÒ»¸öʱ¼äÖ®½ØÈ¡ÆäÖеÄÒ»²¿·Ö¾Í³ÉÁËÎÊÌâ¡£
ÓÐÁ½¸ö½â¾ö·½·¨£º
×îÖ±½ÓµÄÏë·¨ÀûÓÃDatePart»òÕßYear¡¢Month¡¢Dayº¯Êý
CAST(
    (
      STR( YEAR( GETDATE() ) ) + '/' +
      STR( MONTH( GETDATE() ) ) + '/' +
      STR( DAY( GETDATE() ) )
    )
    AS DATETIME
)
Èç¹ûÖ»ÒªÄêºÍÔ£¬¾ÍÊ¡µôÇ°ÃæµÄ¡£
·½·¨¶þ£¬ÀûÓÃʱ¼ä¼ÆË㺯Êý
ÀýÈç»ñµÃÔÂ
DateAdd(month, DateDiff(month, 0, Coltime), 0)
Ô­Àí¾ÍÊÇÊý¾Ý¿âʱ¼äÖµColtime¼õµô1900-1-1»ñµÃÕâÆÚ¼äµÄÔ·ݸöÊý£¬È»ºóÔÙÖØмӻØ1900-1-1¡£


Ïà¹ØÎĵµ£º

ORACLEºÍSQLÓï·¨Çø±ð¹éÄÉ

ORACLEºÍSQLÓï·¨Çø±ð¹éÄÉ
Êý¾ÝÀàÐͱȽÏ
ÀàÐÍÃû³Æ
Oracle
SQLServer
±È½Ï
×Ö·ûÊý¾ÝÀàÐÍ CHAR CHAR ¶¼Êǹ̶¨³¤¶È×Ö·û×ÊÁϵ«oracleÀïÃæ×î´ó¶ÈΪ2kb£¬SQLServerÀïÃæ×î´ó³¤¶ÈΪ8kb
±ä³¤×Ö·ûÊý¾ÝÀàÐÍ VARCHAR2 VARCHAR OracleÀïÃæ×î´ó³¤¶ÈΪ4kb£¬SQLServerÀïÃæ×î´ó³¤¶ÈΪ8kb
¸ù¾Ý×Ö·û¼¯¶ø¶¨µÄ¹Ì¶¨³¤¶È×Ö·û´® NCHAR NCHA ......

SQL ÈÕÆÚת»»

http://xujunprogrammer.blog.hexun.com/8376520_d.html
SQL ServerÖÐÎÄ°æµÄĬÈϵÄÈÕÆÚ×Ö¶Îdatetime¸ñʽÊÇyyyy-mm-dd Thh:mm:ss.mmm
ÀýÈç:
select getdate()
2004-09-12 11:06:08.177
Õâ¶ÔÓÚÔÚÒª²»Í¬Êý¾Ý¿â¼äתÒÆÊý¾Ý»òÕßÏ°¹ßoracleÈÕÆÚ¸ñʽYYYY-MM-DD HH24:MI:SSµÄÈ˶àÉÙÓÐЩ²»·½±ã.
ÎÒÕûÀíÁËÒ»ÏÂSQL ServerÀïÃæ¿ÉÄ ......

SQLÓï¾äÓÅ»¯¼¼Êõ·ÖÎö

Ò»¡¢²Ù×÷·ûÓÅ»¯
1¡¢IN ²Ù×÷·û
ÓÃINд³öÀ´µÄSQLµÄÓŵãÊDZȽÏÈÝÒ×д¼°ÇåÎúÒ׶®£¬Õâ±È½ÏÊʺÏÏÖ´úÈí¼þ¿ª·¢µÄ·ç¸ñ¡£µ«ÊÇÓÃINµÄSQLÐÔÄÜ×ÜÊDZȽϵ͵ģ¬´ÓOracleÖ´ÐеIJ½ÖèÀ´·ÖÎöÓÃINµÄSQLÓë²»ÓÃINµÄSQLÓÐÒÔÏÂÇø±ð£º
ORACLEÊÔͼ½«Æäת»»³É¶à¸ö±íµÄÁ¬½Ó£¬Èç¹ûת»»²»³É¹¦ÔòÏÈÖ´ÐÐINÀïÃæµÄ×Ó²éѯ£¬ÔÙ²éѯÍâ²ãµÄ±í¼Ç¼£¬Èç¹ûת»»³É¹ ......

SQL Server 2008ÐÂÌØÐÔ£­Êý¾ÝѹËõ

Êý¾ÝѹËõ£¨Data Compression£©ÊÇSQL Server 2008ÒýÈëµÄÐÂÌØÐÔÖ®Ò»£¬ÕâÏî¼¼ÊõʹÊý¾Ý¸üÓÐЧµÄ±£´æ²¢ÇÒ¼«´ó¼õÉÙÁË´æ´¢¿ªÏú£¬Í¬Ê±Ò²´øÀ´ÁËÐÔÄÜÉϵÄÏÔÖøÌá¸ß£¬ÓÈÆäÊǶÔÐèÒª´óÁ¿´ÅÅÌI/OµÄÊý¾Ý²Ö¿â¡£
 
×¢£ºÆäʵÔÚSQL Server 2005 SP2°æ±¾ÖУ¬ÒѾ­ÒýÈëÁË vardecimal £¬ËüʹÓñ䳤µÄ¸ñʽ´æ´¢¶¨³¤µÄdecimalºÍnumbericÊý¾Ý¡£
......

¸ßЧSQL·ÖÒ³´æ´¢¹ý³Ì

CREATE PROCEDURE fenye
@tblName varchar(255)='wdf1', -- ±íÃû
@strGetFields varchar(1000) = '*', -- ÐèÒª·µ»ØµÄÁÐ
@fldName varchar(255)='userid', -- ÅÅÐòµÄ×Ö¶ÎÃû
@PageSize int = 10, -- Ò³³ß´ç
@PageIndex int = 1, -- Ò³Âë
@doCount bit = 0, -- ·µ»Ø¼Ç¼×ÜÊý, ·Ç 0 ÖµÔò·µ»Ø
@OrderType bit = 0, -- Éè ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ