I need to have my results displayed in as many columns as the results need (the number of columns will vary depending on the record) instead of the rows the results are currently being written to.
Here's a sample resultset as it is dumped into rows:
ID lname fname response current
100 Doe John Mickey Donald
100 Doe John Mickey Tweety
100 Doe John Mickey Daffy
100 Doe John Minnie Pluto
100 Doe John Daffy Pluto
Here's what I need it to be:
ID lname fname response1 response 2 current1 current2 current3
100 Doe John Mickey Donald Tweety Daffy
100 Doe John Minnie Daffy Pluto
Or it can be like this: (This way would be awesome!)
ID lname fname response1 current1 response2 current2
100 Doe John Mickey Donald Minnie Pluto
To complicate matters, the database this is being written against is Intersystems' Caché, which is FAR from SQL Server unfortunately, so I can't do temp tables, stored procs or other normal database stuff.