Hi Monks,
I have a database table named location The table will look like
| ID (Primary Key, Auto Increment) | State | City |
| 1 | Virginia | Norfolk |
| 2 | Virginia | Chesapeake |
| 3 | Virginia | Virginia Beach |
| 4 | Indiana | Evansville |
| 5 | Indiana | Fort Wayne |
| 6 | Virginia | Falls Church |
| 7 | Indiana | Indianapolis |
| 8 | Washington | Seatle |
| 9 | Washington | Spokane |
I need to sort this table by primary key, but grouped by state. ie, the result will be
| ID (Primary Key, Auto Increment) | State | City |
| 1 | Virginia | Norfolk |
| 2 | Virginia | Chesapeake |
| 3 | Virginia | Virginia Beach |
| 6 | Virginia | Falls Church |
| 4 | Indiana | Evansville |
| 5 | Indiana | Fort Wayne |
| 7 | Indiana | Indianapolis |
| 8 | Washington | Seatle |
| 9 | Washington | Spokane |
Few things need to remember is
Can anybody give some idea? I wish to have a "perl" solution.
Thanks in advance :)
--VC
Updates
In reply to Sorting and Grouping with two different fields by atemon
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |