Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. Database & SysAdmin
  3. Database
  4. Show Column Name once for similar records

Show Column Name once for similar records

Scheduled Pinned Locked Moved Database
3 Posts 3 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    NET India
    wrote on last edited by
    #1

    I'm fetching records from a table as shown below <b>ID Name PID</b> 1 Ram 10 1 Ram 20 2 Shyam 30 2 Shyam 40 2 Shyam 50 3 Rohit 60 But i want to display records as shown below i. mean to show common name for similar fields <b>ID Name PID</b> 1 Ram 10 - - 20 2 Shyam 30 - - 40 - - 50 3 Rohit 60

    M P 2 Replies Last reply
    0
    • N NET India

      I'm fetching records from a table as shown below <b>ID Name PID</b> 1 Ram 10 1 Ram 20 2 Shyam 30 2 Shyam 40 2 Shyam 50 3 Rohit 60 But i want to display records as shown below i. mean to show common name for similar fields <b>ID Name PID</b> 1 Ram 10 - - 20 2 Shyam 30 - - 40 - - 50 3 Rohit 60

      M Offline
      M Offline
      Mycroft Holmes
      wrote on last edited by
      #2

      The relevant word here is display, you are asking the database to do the work of the presentation layer, that is not the database job. Use your presentation layer to do this formating.

      Never underestimate the power of human stupidity RAH

      1 Reply Last reply
      0
      • N NET India

        I'm fetching records from a table as shown below <b>ID Name PID</b> 1 Ram 10 1 Ram 20 2 Shyam 30 2 Shyam 40 2 Shyam 50 3 Rohit 60 But i want to display records as shown below i. mean to show common name for similar fields <b>ID Name PID</b> 1 Ram 10 - - 20 2 Shyam 30 - - 40 - - 50 3 Rohit 60

        P Offline
        P Offline
        ps_prakash02
        wrote on last edited by
        #3

        HAVE A LOOK THROUGH THIS LINK, http://www.projectdmx.com/tsql/rowconcatenate.aspx[^]

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups