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

sqlÓï¾ä µÝ¹é

select s.*  from t_info t,t_info_class_relationship s where t.id=s.info_id and t.status is not null and s.class_id in(
select a.id
    from T_INFO_CLASS a
    start with a.parent_id=39902
    connect by prior
    a.id =parent_id union
    select 39902 from dual)


Ïà¹ØÎĵµ£º

SQL Server 2005È«ÎļìË÷¼¼ÊõÔÚÍøÕ¾ÉϵÄÓ¦ÓÃʵ¼


Ò»¡¢Ç°ÑÔ
“ÈËÀàʧȥËÑË÷£¬ÊÀ½ç½«»áÔõÑù?”£¬Í¬Ñù£¬ºÜÄÑÏëÏóÒ»¸öÓµÓм«´óÐÅÏ¢Á¿µÄÐÐÒµÍøÕ¾ÃÅ»§Ã»ÓÐÕ¾ÄÚÈ«ÎÄËÑË÷½«»á³öÏÖÔõÑùµÄ¾ÖÃ棬ÍøվȫÎļìË÷¶ÔÓÚÍÚ¾òÍøÕ¾ÐÅÏ¢ºÍÕûºÏÍøÕ¾×ÊÔ´µÄ¼ÛÖµÊDz»ÑÔ¶øÓ÷µÄ¡£ÎÒÃÇ¿´µ½£¬Í¨ÓÃÐ͵ÄËÑË÷ÒýÇæÒѾ­³ÉΪÁË»¥ÁªÍøÊÀ½çµÄÃÅ»§£¬¶ø¶ÔÓÚÒ»¸öÐÅÏ¢Á¿¼«Æä·á¸»µÄÍøÕ¾¶øÑÔ£¬È«ÍøËÑË÷»òÐ ......

SQL server2005ÖÐÓÃpivotʵÏÖÐÐÁÐת»»

 --> --> (Roy)Éú³É²âÊÔÊý¾Ý
if not object_id('Class') is null
drop table Class
Go
Create table Class([Student] nvarchar(2),[Course] nvarchar(2),[Score] int)
Insert Class
select N'ÕÅÈý',N'ÓïÎÄ',78 union all
select N'ÕÅÈý',N'Êýѧ',87 union all
select N'ÕÅÈý',N'Ó¢Óï',82 union all
sel ......

SQL×¢Èë

      Ëæ×ÅB/SģʽӦÓÿª·¢µÄ·¢Õ¹£¬Ê¹ÓÃÕâÖÖģʽ±àдӦÓóÌÐòµÄ³ÌÐòÔ±Ò²Ô½À´Ô½¶à¡£µ«ÊÇÓÉÓÚÕâ¸öÐÐÒµµÄÈëÃÅÃż÷²»¸ß£¬³ÌÐòÔ±µÄˮƽ¼°¾­ÑéÒ²²Î²î²»Æ룬Ï൱´óÒ»²¿·Ö³ÌÐòÔ±ÔÚ±àд´úÂëµÄʱºò£¬Ã»ÓжÔÓû§ÊäÈëÊý¾ÝµÄºÏ·¨ÐÔ½øÐÐÅжϣ¬Ê¹Ó¦ÓóÌÐò´æÔÚ°²È«Òþ»¼¡£Óû§¿ÉÒÔÌá½»Ò»¶ÎÊý¾Ý¿â²éѯ´úÂ룬¸ù¾Ý³ÌÐò ......

oracle sql*plus set &spool½éÉÜ(Ò»)

1). ÉèÖõ±Ç°sessionÊÇ·ñ¶ÔÐ޸ĵÄÊý¾Ý½øÐÐ×Ô¶¯Ìá½» :SET AUTO[COMMIT] {ON|OFF|IMM[EDIATE]| n}
SQL> set autocommit off
2)£®ÔÚÓÃstartÃüÁîÖ´ÐÐÒ»¸ösql½Å±¾Ê±£¬ÊÇ·ñÏÔʾ½Å±¾ÖÐÕýÔÚÖ´ÐеÄSQLÓï¾ä :SET ECHO {ON|OFF}
SQL> set echo on
3).ÊÇ·ñÏÔʾµ±Ç°sqlÓï¾ä²éѯ»òÐ޸ĵÄÐÐÊý
SQL> SET FEED[BACK] {6|n|O ......

SQL ¸½¼ÓÊý¾Ý¿âʱ³öÏÖ ÎÞ·¨´ò¿ªÎïÀíÎļþ´íÎó

SQL ¸½¼ÓÊý¾Ý¿âʱ³öÏÖ ÎÞ·¨´ò¿ªÎïÀíÎļþ´íÎó
´íÎóÐÅÏ¢:
Ö´ÐÐ Transact-SQL Óï¾ä»òÅú´¦Àíʱ·¢ÉúÁËÒì³£¡£ (Microsoft.SqlServer.ConnectionInfo)
------------------------------
ÎÞ·¨´ò¿ªÎïÀíÎļþ "D:\SqlDataBase\Test.mdf"¡£²Ù×÷ϵͳ´íÎó 5:"5(¾Ü¾ø·ÃÎÊ¡£)"¡£ (Microsoft SQL Server£¬´íÎó: 5120)
½â¾ö°ì·¨:
  ......
© 2009 ej38.com All Rights Reserved. ¹ØÓÚE½¡ÍøÁªÏµÎÒÃÇ | Õ¾µãµØͼ | ¸ÓICP±¸09004571ºÅ