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.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 How to view data ?

Author  Topic 

pamyral_279
Posting Yak Master

143 Posts

Posted - 2006-06-20 : 00:00:18
I have table:
ID Name Value
1 A V1
2 B V2
3 A V3
4 E V4
5 A V5
6 G V6
7 B V7
8 E V8

Now i want to display :

Name : A
1 V1
3 V3
5 V5
Name : B
2 V2
7 V7
Name : E
4 V4
8 V8
Name : G
6 V6

Any one help me ?
Thank you very much.

khtan
In (Som, Ni, Yak)

17689 Posts

Posted - 2006-06-20 : 00:10:13
You should do the presentation and formating of data in your front end application and not in SQL Server
Just use ORDER BY to sort it by Name the ID and shows the data in front end.

select Name, ID, Value
from table
order by Name, ID



KH

Go to Top of Page

madhivanan
Premature Yak Congratulator

22864 Posts

Posted - 2006-06-20 : 02:08:06
If you use Reports, then group it by Name

Madhivanan

Failing to plan is Planning to fail
Go to Top of Page
   

- Advertisement -