|
venkatkrishna
Starting Member
12 Posts |
Posted - 2007-05-21 : 02:24:15
|
| Hello,The following stmt written in Oracle contains the some predefiend functions like sys_connect_by_path,start with,connect by prior. can any help me to get the same sql server stmt to get the same result.SELECT ccd, tcd, loc_id, t.rcd tsr, SUBSTR (sys_connect_by_path (t.ttid, ','), 2, INSTR (sys_connect_by_path (t.ttid, ',' ), ',', 1, 2 ) - 2 ) rm_ttid, CASE WHEN LEVEL = 2 THEN ttid ELSE SUBSTR (sys_connect_by_path (t.ttid, ',' ), INSTR (sys_connect_by_path (t.ttid, ',' ), ',', 1, 2 ) + 1, INSTR (sys_connect_by_path (t.ttid, ',' ), ',', 1, 3 ) - INSTR (sys_connect_by_path (t.ttid, ',' ), ',', 1, 2 ) - 1 ) END dm_ttid FROM v_da_ff_territory t WHERE ccd = 'AM' AND t.active_fg = 'Y' AND t.territory_type_cd = 'FF' --and t.rcd <> 'TSR' START WITH rcd = 'R' CONNECT BY PRIOR ttid = t.rpt_lvl1_terrRegards,Krishna |
|