Jump to content

grouping arrays, sorting.


chewwy

Recommended Posts

i'm not sure if this could be done in SQL itself, i don't think so, so i'll ask here.

right.  i have 6 columns of data in a MySQL table which i want to group all together, then sort alphabetically, while remembering what row of the table they belong to (i.e. there could be a 7th column, a number, and there'd be 6 pieces of data attahced to that number.  help the noob?

the alternative would be to have just 2 columns, with each number repeated 6 times.  then i could sort them easily in SQL, and not have to resort to PHP.  however i'm a little too far down the road to do that...
Link to comment
Share on other sites

So you want to get all the data, from all the columns and rows, and sort the whole lot alphabetically while remembering which row each bit of data came from? If that's the case I think I would look at building a temporary table and doing the sort on that, I don't know if that's the best solution.
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.