Please start any new threads on our new
site at https://forums.sqlteam.com. We've got lots of great SQL Server
experts to answer whatever question you can come up with.
Author |
Topic |
pelegk2
Aged Yak Warrior
723 Posts |
Posted - 2012-09-11 : 05:34:02
|
i want to display a table in Hierarchie.the thing is that the table dosen't have parent id or somthing like that.attached is an example for before and after10X :)  |
|
Mike Jackson
Starting Member
37 Posts |
Posted - 2012-09-11 : 08:27:27
|
I don't see your examples, please repost. |
 |
|
pelegk2
Aged Yak Warrior
723 Posts |
Posted - 2012-09-11 : 08:34:15
|
http://s14.postimage.org/my8x11lnz/image.jpg |
 |
|
pelegk2
Aged Yak Warrior
723 Posts |
Posted - 2012-09-11 : 08:58:09
|
solvedselect CASE WHEN MIN(t.r) = 1 then t.name1 ELSE '' END as name1, t.name2, t.name3, sum(t.sum1), sum(t.sum2)from (select *, ROW_NUMBER() over(partition by name1 order by name1) r from #tbl1) as tgroup by t.name1, t.name2, t.name3 |
 |
|
|
|
|