paskuda - you seem to be confusing this site with rentacoder.com. This is not a code writing service.
You have been given lots of ideas here that should assist you in writing your query. Quite frankly, this is one of the more common questions asked on the site, and people get a little tired of writing the code for it. I certainly do anyways. So if the examples given aren't cutting it for you, try a search (tek-tips' google search still works well).
If you are using SQL 2000 (you didnt' say) what you will need to do is build an incredibly long query (well, incredibly long if you have over a thousand ID's or so anyways) in a stored procedure that will have a case statement for every single ID value in your table, resulting in something like this:
Code:
select max(case ID when 1 then name else '' end) as 1
, max(case ID when 2 then name else '' end) as 2
, max(case ID when 3 then name else '' end) as 3
from leTable
But the best advice you could get, is leave the pivoting to excel (or whatever your presentation layer is) where it belongs, if at all possible.
Hope this helps,
Alex
[small]----signature below----[/small]
With all due respect, Don Bot, I don't think we should rely on an accident happening. Let's kill him ourselves.
Ignorance of certain subjects is a great part of wisdom