Jump to content

Archived

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

chewwy

grouping arrays, sorting.

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

Share this post


Link to post
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.

Share this post


Link to post
Share on other sites

×

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.