Loading ...
Sorry, an error occurred while loading the content.

10653Re: [PkOug] Need Query

Expand Messages
  • Muhammad Farooq
    Nov 6, 2013
    • 0 Attachment
      Dear Majid Tahir

      check this one..

      select student_reg_no,rtrim(xmlagg(xmlelement(e, course_id || ',')).extract('//text()').extract('//text()') ,',') course_id from course
      group by student_reg_no;
       
      Regards,
       
      MUHAMMAD FAROOQ
      Deputy Manager Systems
      Samin Textile ltd. Lahore
      Cell: +92-306-7037237
       


      On Wednesday, November 6, 2013 4:26 PM, Majid Tahir <tahir.majid@...> wrote:
       
      AOA,
      Dear Members,
      I have following tables

      table student:

      student_name       student_reg_no
      ali                                  1
      tahir                                2

      table course

      student_reg_no            course id
                1                             1
                 1                            2
                 1                            3
      I need a query to represent the course in single coulumns
      like
      student_reg_no                 course id
      1                                         1,2,3

      how can i write this query, kindly help


    • Show all 9 messages in this topic