Show Column Name once for similar records
-
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
-
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
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
-
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
HAVE A LOOK THROUGH THIS LINK, http://www.projectdmx.com/tsql/rowconcatenate.aspx[^]