Connecting Tech Pros Worldwide Help | Site Map

Display Output

Newbie
 
Join Date: Nov 2009
Posts: 1
#1: 2 Weeks Ago
I'm looking for a query that can take a table with data in this format:


Expand|Select|Wrap|Line Numbers
  1. id  name   date
  2. 1   data1  10-28-09
  3. 2   data1  10-28-09
  4. 3   data1  10-28-09
  5. 4   data2  10-29-09
  6. 5   data2  10-29-09
  7. 6   data2  10-29-09
  8. 7   data3  10-30-09
  9. 8   data3  10-30-09
  10. 9   data3  10-30-09
and return it in this format



Expand|Select|Wrap|Line Numbers
  1. 10-28-09 10-29-09 10-30-09
  2. data1    data2    data3
  3. data1    data2    data3
  4. data1    data2    data3
Any suggestions?
Atli's Avatar
Moderator
 
Join Date: Nov 2006
Location: Iceland
Posts: 3,731
#2: 2 Weeks Ago

re: Display Output


Hey.

No practical query can produce those results.

Having said that, you *could* probably get those results by using Stored Procedures and temporary tables, but I wouldn't recommend it. It would most likely be a major resource hog.

It is the job of your front-end applications to format the data for output, not the database itself. It is meant to store and retrieve the data, not display it.
Reply

Tags
mysql