ewaters / altsql-shell

An easily extensible DBI shell, perfect for a drop-in replacement to mysql-client
http://ewaters.github.com/altsql-shell
123 stars 19 forks source link

Sort last table result #6

Open ewaters opened 12 years ago

ewaters commented 12 years ago

Similar to issue #1, it'd be nice to take the table result and sort it according to a different column.

Perhaps something like this:

altsql> select country, count(id) from people group by country;
altsql> .sort country asc;

The count(*) and group by was an expensive operation. You don't want to have to execute it again just to change the sort order, but you'd like to see the data resorted on a different column. If you wanted it resorted according to the second column, you could use positional selector:

altsql> .sort column 2 desc;

This would result in the data being re-rendered but according to the new sort order.

Optionally support multisort declarations.