首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 数据库 > SQL Server >

联接sql

2012-07-18 
连接sqlselect substr(sys_connect_by_path(v_param_name, ,), 2) a, a.*from (select aa.*,v_item_id |

连接sql
select substr(sys_connect_by_path(v_param_name, ','), 2) a, a.*
  from (select aa.*,
               v_item_id || ',' || (rno + 1) rno1,
               v_item_id || ',' || rno rno2
          from (select v_item_id,
                       v_param_name,
                       row_number() over(partition by v_item_id order by n_param_id) rno,
                       row_number() over(partition by v_item_id order by n_param_id desc) flag
                  from tb_pu_parameter) aa) a
where flag = 1
connect by prior rno1 = rno2
start with rno = 1

热点排行