Results 1 to 2 of 2
  1. #1
    Join Date
    Jul 2011
    Posts
    4

    Unanswered: display row wise date to column wise month

    Hi

    Please help me for preparing the query. it is very usefull for me.

    i have the data row wise like

    studentid paiddate payment

    1 01/01/2012 1000
    1 02/01/2012 200
    1 03/01/2012 400
    1 04/01/2012 500
    1 05/01/2012 600
    1 12/01/2011 300

    i want to display above data to

    studentid jan-2012 feb-2012 march-2012 april-2012 may-2012 dec-2011

    1 1000 200 400 500 600 300


    Please help me ...how to prepare the query for displying like above


    Thx.

  2. #2
    Join Date
    Feb 2008
    Location
    Japan
    Posts
    3,483
    Please see PIVOT in this presentation.
    http://sirdug.org/downloads/SQLonFire_1_SirDUG.pdf

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •