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

10654Re: [PkOug] Need Query

Expand Messages
  • Osama maqbool,
    Nov 9, 2013
      Listagg is only used in oracle 11g
      here is the tested query on oracle 10g 100% fine.
      select deptno,
             rtrim (xmlagg (xmlelement (e, ename || ',')).extract ('//text()'), ',') enames
      from emp
      group by deptno

      Regards
      Abdul Samad
      Associate Technical Consultant.


      On Friday, November 8, 2013 12:22 AM, Badruddin Hunzai <badarhunzai@...> wrote:
       
      Dear Tahir,

      It's a very simple query.  You need to join both tables.


      SELECT
      student_reg_no,
      course_id
      FROM
                  Student s,
                  Course c
      WHERE
                  c. student_reg_no=s. student_reg_no;

      Good luck.

      Badar


      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