Jump to content

Transforming a table


Breka

Recommended Posts

Hello All,

 

I have a problem that I can solve mathematically but is rather difficult in MySQL world.  Here is the issue: I have a table that looks like the following:

 

| label_a | label_b | label_c | label_d |

|    a    |  NULL  |  NULL  |  NULL  |

|  NULL  |    b      |  NULL  |  NULL  |

|  NULL  |  NULL  |    c      |  NULL  |

|  NULL  |  NULL  |  NULL  |    d    |

 

and I want it to look like the following:

 

| label_a | label_b | label_c | label_d |

|    a      |    b    |    c      |    d    |

 

Any thoughts?  I really want to stay away from subqueries as the tables are relatively massive.  Thank you!

Link to comment
https://forums.phpfreaks.com/topic/158294-transforming-a-table/
Share on other sites

The rows are the result of an executed query.  I was hoping that there was some manner of transformation on the result set that didn't involve manipulation of the original query whatsoever.  For example, mathematically, I'd look at multiplying the matrix on the left by a n x 1 row vector of 1's to produce a n x 1 vector of values. 

Link to comment
https://forums.phpfreaks.com/topic/158294-transforming-a-table/#findComment-835006
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.