I want to be able to order the column names when I do a describe
statement in SQL:
use <db_name>;
describe <table_name>;
What do I order it by?
use <db_name>;
describe <table_name> order by <????>;
Thanks.
I want to be able to order the column names when I do a describe
statement in SQL:
use <db_name>;
describe <table_name>;
What do I order it by?
use <db_name>;
describe <table_name> order by <????>;
Thanks.
You cannot (easily) do this directly with MySQL, however, you can get the result with a simple shell wrapper:
mysql --e 'describe <table_name_goes_here>' --batch | sort -k 1