OracleÖУ¬ÓÃÒ»ÌõSqlʵÏÖÈÎÒâµÄÐÐתÁÐÆ´½Ó ¶àÐÐÆ´½Ó
±í½á¹¹ºÍÊý¾ÝÈçÏ£¨±íÃûTest£©£º
NO VALUE NAME
1 a ²âÊÔ1
1 b ²âÊÔ2
1 c ²âÊÔ3
1 d ²âÊÔ4
2 e ²âÊÔ5
4 f ²âÊÔ6
4 g ²âÊÔ7
SqlÓï¾ä£º
select No,
ltrim(max(sys_connect_by_path(Value, ';')), ';') as Value,
ltrim(max(sys_connect_by_path(Name, ';')), ';') as Name
from (select No,
Value,
Name,
rnFirst,
lead(rnFirst) over(partition by No order by rnFirst) rnNext
from (select a.No,
a.Value,
a.Name,
row_number() over(order by a.No, a.Value desc) rnFirst
from Test a) tmpTable1) tmpTable2
&n
Ïà¹ØÎĵµ£º
OracleÊý¾Ý¿âÌṩÁ˼¸ÖÖ²»Í¬µÄÊý¾Ý¿âÆô¶¯ºÍ¹Ø±Õ·½Ê½£¬±¾ÎĽ«Ïêϸ½éÉÜÕâЩÆô¶¯ºÍ¹Ø±Õ·½Ê½Ö®¼äµÄÇø±ðÒÔ¼°ËüÃǸ÷×Ô²»Í¬µÄ¹¦ÄÜ¡£
Ò»¡¢Æô¶¯ºÍ¹Ø±ÕOracleÊý¾Ý¿â
¡¡¡¡¶ÔÓÚ´ó¶àÊýOracle DBAÀ´Ëµ£¬Æô¶¯ºÍ¹Ø±ÕOracleÊý¾Ý¿â×î³£Óõķ½Ê½¾ÍÊÇÔÚÃüÁîÐз½Ê½ÏµÄServer Manager¡£´ÓOracle 8iÒÔºó£¬ÏµÍ³½«Server ManagerµÄËùÓй¦Äܶ¼¼¯Öе ......
Ò»£ºC# Á¬½ÓSQLÊý¾Ý¿â
Data Source=myServerAddress;Initial Catalog=myDataBase;User Id=myUsername;Password=myPassword;
Data Source=190.190.200.100,1433;Network Library=DBMSSOCN;Initial Catalog=myDataBase;User ID=myUsername;Password=myPassword;
Server=myServerAddress;Database=myDataBase;User ID=myUse ......
¡¡¡¡×ܵÄÀ´Ëµ£¬MS SQL 2005µÄ°²È«ÐÔ±ÈSQL 2000ҪǿÉϲ»ÉÙ£¬²»¹ýĬÈÏÉèÖû¹ÊÇÓкÍÔÀ´Ò»ÑùµÄ©¶´£¬ÏÂÃæÎÒÃÇÀ´ÐÞ¸ÄÒ»ÏÂĬÈÏÉèÖá£
¡¡¡¡1¡¢ÐÞ¸ÄĬÈÏ£Ó£ÁÃÜÂë¡£
¡¡¡¡°²×°MSSQLʱʹÓûìºÏģʽ£¬µ±È»SAÃÜÂë×îºÃ²»ÄÜΪ¿Õ£¬ÔÚSQL2005ÖУ¬¿ÉÒÔ¶ÔSAÕâ¸ö³¬¼¶Óû§Ãû½øÐÐÐ޸Ļòɾ³ý¡£
use master
ALTER LOGIN [ ......