View Single Post
  #9 (permalink)  
Old 07-17-2007, 12:40 AM
priyan priyan is offline
D-Web Sr.Programmer
 
Join Date: Mar 2007
Posts: 133
priyan is on a distinguished road
Default Re: Use on group_concat

Hi Prasad,

As you said there is no pre definied function (like GROUP_CONCAT in mysql) available in MS-SQL or Oracle.

for MS-SQL we need to use stored function / precedure to get the result as desired. There is no direct function available for group_concat in oracle also.

CREATE OR REPLACE TYPE ntt_varchar2 AS TABLEOF VARCHAR2(4000);
select deptno, cast(collect(ename) as ntt_varchar2) as vals from emp group by deptno

I tried your points in oracle, but it throws error like this...
ORA-00904: "COLLECT": invalid identifier

Can u please clarify ?
__________________
Keep smiling...
Reply With Quote