how to sort column by descending and match pairs on another column on mysql
I don't think I even phrase it right, but I'll display the table before
and after the sort.
Before Sort:
___________________
| NAME | AGE |
|==================|
| Ace | 23 |
| May | 15 |
| Ann | 21 |
| May | 38 |
| Ace | 77 |
| Ann | 35 |
|==================|
After Sort:
___________________
| NAME | AGE |
|==================|
| Ace | 77 |
| Ace | 23 |
| May | 38 |
| May | 15 |
| Ann | 35 |
| Ann | 21 |
|==================|
So, as you can see I am sorting by age in descending order but, it will
pair up the ones with the same Name together. How would I do this in
MySQL?
Thanks!
No comments:
Post a Comment