Click here to Skip to main content
15,922,155 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more: , +
HTML
i need to display Distinct Records 


Col1              Col2              Col3       Col4
A                   1                 2          1
A                   1                 2          2
A                   2                 1          1
A                   2                 1          2
B                   3                 2          2
B                   3                 1          1






Need Result Like
Col1              Col2              Col3       Col4
A                   1                 2          1
                    2                 1          2

B                   3                 2          2
                                      1          1


Please Help Me......
Posted
Updated 24-Apr-13 6:40am
v3

1 solution

You can't do that with any RDBMS, since what you desire is not "distinct record" result. It is a multilevel master-detail representation of your data. Please note that the query result is a set, thus (even if you can have ordered presentation) you can't have a result that has no meaning when the order is changed. Look at your result set and imagine that you swap rows randomly.
So you will have to achieve this presentation on a higher level, like in your application presentation layer (GUI).
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900