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

sql ÈÕÆÚÆ´½Ó

      ÔÚ±¾ÎÄÖУ¬GetDate()»ñµÃµÄÈÕÆÚÓÉÁ½²¿·Ö×é³É£¬·Ö±ðÊǽñÌìµÄÈÕÆں͵±Ê±µÄʱ¼ä£ºSelect GetDate() ÓÃDateName()¾Í¿ÉÒÔ»ñµÃÏàÓ¦µÄÄê¡¢Ô¡¢ÈÕ£¬È»ºóÔÙ°ÑËüÃÇÁ¬½ÓÆðÀ´¾Í¿ÉÒÔÁË£º
¡¡¡¡
      Select Datename(year,GetDate())+'-'+Datename(month,GetDate())+'-'+Datename(day,GetDate())
¡¡¡¡ÁíÍ⣬DateName()»¹¿ÉÒÔ»ñµÃµ½Ð¡Ê±¡¢Ê±¼ä¡¢Ãë¡¢ÐÇÆÚ¼¸¡¢µÚ¼¸ÖÜ£¬·Ö±ðÈçÏ£º
¡¡¡¡
      Select Datename(hour,GetDate())
      Select Datename(minute,GetDate())
      Select Datename(second,GetDate())
      Select Datename(weekDay,GetDate())
      Select Datename(week,GetDate())
¡¡¡¡
      µÃµ½µÄÊÇNvarcharÀàÐÍ£¬ÐèҪת»»Convert(datetime,Æ´½ÓµÄÈÕÆÚ, 0)


Ïà¹ØÎĵµ£º

Àμǣ¡SQL ServerÊý¾Ý¿â¿ª·¢µÄ¶þʮһÌõ¾ü¹æ(SQLÊÕ²Ø)

Èç¹ûÄãÕýÔÚ¸ºÔðÒ»¸ö»ùÓÚSQL ServerµÄÏîÄ¿£¬»òÕßÄã¸Õ¸Õ½Ó´¥SQL Server£¬Ä㶼ÓпÉÄÜÒªÃæÁÙһЩÊý¾Ý¿âÐÔÄܵÄÎÊÌ⣬ÕâƪÎÄÕ»áΪÄãÌṩһЩÓÐÓõÄÖ¸µ¼£¨ÆäÖдó¶àÊýÒ²¿ÉÒÔÓÃÓÚÆäËüµÄDBMS£©¡£
ÔÚÕâÀÎÒ²»´òËã½éÉÜʹÓÃSQL ServerµÄÇÏÃÅ£¬Ò²²»ÄÜÌṩһ¸ö°üÖΰٲ¡µÄ·½°¸£¬ÎÒËù×öµÄÊÇ×ܽáһЩ¾­Ñé----¹ØÓÚÈçºÎÐγÉÒ»¸öºÃµÄÉè¼Æ¡£Õ ......

SQL Server: Inner Join¼°Outer Join, Natrual Jion

Ò»¡¢NATURAL JOIN£¨×ÔÈ»Á¬½Ó£©
     Á½Õűíͨ¹ýNATURAL JOINÁ¬½ÓµÄʱºò£¬Ï൱ÓÚÓиöÒþº¬µÄWHERE×Ӿ䣬¶ÔÁ½ÕűíÖÐͬÃûµÄ¶ÔÓ¦ÁÐÏà±È½Ï¿´ÊÇ·ñÏàµÈ¡£
¶þ¡¢CROSS JOIN£¨´´½¨µÑ¿¨¶û»ý£©
     ¶ÔÁ½Õűíͨ¹ý½»²æÁªºÏ²úÉúµÚÈýÕÅ·µ»Ø½á¹û¼¯µÄ±í¡£Ï൱ÓÚÆÕͨµÄÁ¬½Ó¡£
Èý¡¢INNER JOIN£ ......

EclipseÖÐHibernateÅäÖÃSQL Server 2000µÄÎÊÌâ

 ×î½üÔÚѧϰHibernate£¬Êý¾Ý¿âÊÇSQL 2000£¬myEclipse7.5£¬¸ù¾ÝÀý×ÓÅäÖúÃHibernateÖ®ºóÔËÐУ¬³öÏÖ£º
com.microsoft.jdbc.base.BaseDatabaseMetaData.supportsGetGeneratedKeys() Õâ¸ö´íÎ󣬵¹ÌÚ°ëÌìÖ®ºó·¢ÏÖÊÇmsbase.jar¡¢mssqlserver.jar¡¢msutil.jarÕâÈý¸ö°üµÄÎÊÌ⣬SQL 2000µÄÊý¾Ý¿âÇý¶¯ÐèÒª×îеİ汾£¬ÕâÈý¸ö°ü¸ ......

SQL ServerÖи÷Êý¾ÝÀàÐͳߴ磨Byte£©


Êý¾ÝÀàÐÍ
´æ´¢³ß´ç
ÃèÊö
bigint
8 bytes
¡¡
integer
4 bytes
¡¡
smallint
2 bytes
¡¡
tinyint
1 byte
¡¡
bit
1 byte
¡¡
numeric(p,s)
decimal(p,s)
dec(p,s)
19 bytes
¡¡
money
8 bytes
¡¡
float
8 bytes
¡¡
real
4 bytes
¡¡
datetime
8 bytes
¡¡
nvarchar(n)
2*³¤¶È bytes
¡¡
nte ......

sqlÁ¬½Ó£¨ÄÚÁ¬½Ó¡¢ÍâÁ¬½Ó¡¢È«Á¬½Ó£©

ÏÖÓÐtable_for_report_1ºÍtable_for_report_2£¬ÏêÇéÈçÏ£º
table_for_report_1ÓÐnum×ֶΣ¬c1,c2,c3×ֶΡ£
Êý¾ÝÈçÏ£º
    num                c1  c2  c3
1 15001346690 11 12 13
2 1 ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ