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
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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.