Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

convert columns to rows?

Status
Not open for further replies.

Neo456

Programmer
Dec 10, 2003
3
0
0
GB
I wonder if anyone can help?
I have a table call T1 that generates the following results
(not complete results)

Date Lost School
2003-10-20, 4, 4700
2003-10-21, 13, 4700
2003-10-23, 5, 4700
2003-11-05, 12, 4700
2003-10-20, 8, 4042
2003-10-21, 4, 4042
2003-10-23, 1, 4042
2003-11-05, 0, 4042

What I would like to do is generate another table from this to convert the columns to rows so it will read like this putting all schools in one row each?

20/10/03 21/10/03 23/10/03 05/11/03
4700 4 13 5 12
4042 8 4 1 0

Many thanks
Neo456
 
Would the new table be static, or need to be created on the fly each time?

 
Thanks Moebius01,

The table will be created on the fly (a view so to speak, Not supported by Mysql presently)

Thanks Neo456
 
perhaps you can also look at the solution in

thread436-720894 it's to report something rather than to work with
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top