Home > Archive > Microsoft SQL Server forum > May 2005 > displaying a table









You are viewing an archived Text-only version of the thread. To view this thread in it's original format and/or if you want to reply to this thread please [click here]

 

Author displaying a table
chudson007@hotmail.com

2005-05-27, 7:23 am

I'm not sure how to go about this and need some help.
I've got a data extract rather than a properly structure table in SQL.
It looks something like below:

Name: Item:
John Ball
John Racket
Paul Ball
Jim Glove
Jim Ball

What sort of script can I run that will return each name once and then
the Items in as many columns needed to list them all?
I=2Ee. so that it will look like
Name: Item1 Item2
John Ball Racket
Paul Ball
Jim Glove Ball


Regards,
Ciar=E1n

Simon Hayes

2005-05-27, 1:23 pm


<chudson007@hotmail.com> wrote in message
news:1117191730.138398.189500@f14g2000cwb.googlegroups.com...
I'm not sure how to go about this and need some help.
I've got a data extract rather than a properly structure table in SQL.
It looks something like below:

Name: Item:
John Ball
John Racket
Paul Ball
Jim Glove
Jim Ball

What sort of script can I run that will return each name once and then
the Items in as many columns needed to list them all?
I.e. so that it will look like
Name: Item1 Item2
John Ball Racket
Paul Ball
Jim Glove Ball


Regards,
Ciarán


The short answer is that this is usually much easier to do in the front end
than in the database; for the long answer, Google for "dynamic crosstab
queries", and also see this KB article:

http://support.microsoft.com/defaul...kb;en-us;175574

Simon


Sponsored Links





Also available: Server administration forum archive | Web Design forum archive | Software forum archive | Hardware reviews archive | Programming forum archive

Copyright 2008 droptable.com