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

SQL Server 2005Ö§³ÖµÄÁ½ÌõÐÂÓï·¨

±¾ÎĽéÉÜÁËSQL Server 2005ÖÐÉÙÊýÈËÓõ½µÄÁ½Ìõ¾«Æ·ÐÂÓï·¨£¬´ó¼Ò¿´¿´×Ô¼ºÊÇ·ñÖªµÀÄØ……
¡¡¡¡1. OUTPUT ... INTO
¡¡¡¡ÓÃÓÚ½«Ò»Ìõ¼Ç¼´Ó±íÒ»Òƶ¯µ½±í¶þʱ·Ç³£ºÃÓ㬳£¼ûÓÚ±¸·Ý¼Ç¼µÄÓ¦ÓÃ
¡¡¡¡ÀýÒ»£º
¡¡¡¡DELETE [TableUseing]
¡¡¡¡OUTPUT *
¡¡¡¡INTO [TableBak]
¡¡¡¡Àý¶þ£º(ÓÃÓÚÒƶ¯Ê±ÐÞ¸Äij×ֶεÄÖµ)
¡¡¡¡DELETE [TableUseing]
¡¡¡¡OUTPUT Field1, Field2, GETDATE()
¡¡¡¡INTO [TableBak]
¡¡¡¡2.±í±äÁ¿
¡¡¡¡ÓÃÓÚ´æ´¢ÁÙʱµÄ²éѯ½á¹û
¡¡¡¡DECLARE @tmp TABLE (ID INT, CITY NVARCHAR(50))
¡¡¡¡INSERT INTO @tmp
¡¡¡¡SELECT MIN(ID), CITY
¡¡¡¡from [TableTest] WITH(NOCLOCK)
¡¡¡¡GROUP BY CITY


Ïà¹ØÎĵµ£º

SQL ServerÖÐpivot and unpivotµÄÓ÷¨ £¨ÐÐÁл¥×ª£©

 .PivotµÄÓ÷¨Ìå»á:
Óï¾ä·¶Àý:
select PN,[2006/5/30] as [20060530],[2006/6/2] as [20060602]
from consumptiondata a
Pivot (sum(a.M_qty) FOR a.M_date in ([2006/5/30],[2006/6/2])) as PVT 
order by PN
 
Table½á¹¹ Consumptiondata (PN,M_Date,M_qty)
order by PN¿ÉÒª¿É²»Òª,²¢²»ÖØ ......

PL/SQLʹÓü¼ÇÉ£¨PL/SQL 7.0.0ÒÔÉÏ£©

 
1¡¢PL
/SQL
Developer¼ÇסµÇ½ÃÜÂë
   ÔÚʹÓÃPL
/SQL
Developerʱ£¬ÎªÁ˹¤×÷·½±ãÏ£ÍûPL
/SQL
Developer¼ÇסµÇ¼OracleµÄÓû§ÃûºÍÃÜÂ룻
ÉèÖ÷½·¨£ºPL
/SQL
Developer 7.1.4 ->tools->Preferences->Oracle->Logon History
£¬ “Store history”ÊÇĬÈϹ´Ñ¡µÄ£¬¹´ÉÏ ......

SQLÖÐtruncate tableºÍdeleteµÄÇø±ð

TRUNCATE TABLE ÔÚ¹¦ÄÜÉÏÓë²»´ø Where ×Ó¾äµÄ Delete
Óï¾äÏàͬ£º¶þÕß¾ùɾ³ý±íÖеÄÈ«²¿ÐС£µ« TRUNCATE TABLE ±È Delete Ëٶȿ죬ÇÒʹÓõÄϵͳºÍÊÂÎñÈÕÖ¾×ÊÔ´ÉÙ¡£
Delete
Óï¾äÿ´Îɾ³ýÒ»ÐУ¬²¢ÔÚÊÂÎñÈÕÖ¾ÖÐΪËùɾ³ýµÄÿÐмǼһÏî¡£TRUNCATE TABLE ͨ¹ýÊÍ·Å´æ´¢±íÊý¾ÝËùÓõÄÊý¾ÝÒ³À´É¾³ýÊý¾Ý£¬²¢ÇÒÖ»ÔÚÊÂÎñÈÕÖ¾ÖмÇÂ¼Ò ......

SQL×Ô¶¯Éú³ÉʵÌåÀà

declare @tablename varchar(20)
select @tablename = 'o_ems'
-------------Éú³É±äÁ¿,ʹÓñí¸ñÐÎʽ(ctrl + D)Êä³ö£¬È¡µÚÒ»¸ö×ֶεÄÖµ----------------------------------
select 'private '+  
Case when t.name='varchar' Then 'string'
    when t.name='char' Then 'string' &nb ......

½â¾öSQL ServerתACCESS×Ô¶¯±àºÅÎÊÌâ

1.´ò¿ªSQL server enterprise mananger "ÆóÒµ¹ÜÀíÆ÷"
ÔÚÄãÒªµ¼³öµÄ SQLÊý¾Ý¿âÉÏÊó±êÓÒ¼ü²Ëµ¥£ºËùÓÐÈÎÎñ-¡·µ¼³öÊý¾Ý

2.»Ø³öÏÖÒ»¸öµ¼³öÏòµ¼´°¿Ú¡£
Ñ¡Ôñ±»µ¼³öµÄÊý¾ÝÔ´£¬ÎªÄã¸Õ²ÅËùÑ¡ÔñµÄÊý¾Ý¿â£¬Èç¹û·¢ÏÖ²»¶ÔÓ¦×ÔÐÐÐ޸ġ£

3.½øÈëµ¼³öµ½Ä¿±êÊý¾ÝÔ´µÄÑ¡Ôñ£¬ÕâÀïÎÒÃÇҪת³ÉACCESSµÄÊý¾Ý¿â¡£×¢ÒâÑ¡ÔñÊý¾ÝÔ´ÀàÐÍΪ&ld ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ