7 Replies Latest reply: May 22, 2012 5:55 AM by 585159 RSS

    Get the column values in a single row seperated by commas

    931381
      Hi

      i have two tables project_baseline and project_resource which have the foreign key project_id from the base table project_details. Now iam trying to retrieve data from these tables using the below query :

      select distinct b.TASK_NAME,r.RESOURCE_NAME,() from project_baseline b inner join project_resource r on R.PROJECT_ID=B.PROJECT_ID group by b.TASK_NAME,r.RESOURCE_NAME

      Below is the output snippet :
      TASK_NAME RESOURCE_NAME

      TEST DESIGN PARAGI M
      TEST DESIGN RAJAN M S
      TEST EXECUTION VIBHU ARMA
      TEST EXECUTION PRATHAB GARG
      TEST EXECUTION NAGABHUSHAN G K
      TEST DATA PREPARATION RAJAN M S
      TEST DATA PREPARATION SHIVA MARAN
      TEST CASE REWORK VISWAN RAM
      TEST CASE REVIEW NAGABHUSHAN G K
      REGRESSION SANGEET
      PROJECT SUPPORT VIBHU ARMA
      PROJECT SUPPORT PRATHAB GARG
      PROJECT SUPPORT PARAGI M
      PROJECT SUPPORT NAGABHUSHAN G K
      PROJECT SUPPORT SANGEET
      PROJECT CLOSURE PRATHAB GARG

      i need to get the resource_names in a single row seperated by comma for a single task like following:

      TASK_NAME RESOURCE_NAME
      PROJECT SUPPORT VIBHU ARMA,PRATHAB GARG,PARAGI M,NAGABHUSHAN G K,SANGEET

      Could anyone please help me to get the query for the above formated output?

      Thanks in advance
      Meera

      Edited by: 928378 on May 22, 2012 5:20 AM