Display data like my structure

  • hai friends

    i want to display the data like the below structures

    for eg:

    customername grade height width

    sqlserver 1024 1000 2000

    1000 3000

    sqlserver1 1025 500 1000

    1000 500

    3000 2000

    here customername,grade are repeating data.so i want to display data like this structure .Any ideas and example is given means which is very helpfull for me

  • rameshduraikannu (10/30/2009)


    hai friends

    i want to display the data like the below structures

    for eg:

    customername grade height width

    sqlserver 1024 1000 2000

    1000 3000

    sqlserver1 1025 500 1000

    1000 500

    3000 2000

    here customername,grade are repeating data.so i want to display data like this structure .Any ideas and example is given means which is very helpfull for me

    how about

    select

    Customer = case row_Number() Over(partition by CustomerName, Grade order by CustomerName, Grade, height, width)

    when 1 then CustomerName

    else ''

    end

    ,grade = case row_Number() Over(partition by CustomerName, Grade order by CustomerName, Grade, height, width)

    when 1 then grade

    else ''

    end

    from <table>

    order by customer, grade, height, width

    Customer

  • hai customer,

    Thanks for ur reply

    please find the attachment and reply your query as for the given structure..

    Thanks/regards

    ramesh

  • hi See attachment

    Note the underscore in the sellect column list, and that the result set is ordered by the original Column Names, which is the same as the columns on which the row_numbers partition subfunction parameters

    hope this is clearer

  • hai SSC-Enthusiastic,

    very.................. thanks..

    thanks for your valuable post,i am new to this forumn, where i have give point or "MARK AS ANSWER"

    Thanks/regards

    ramesh.d

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply