What would be the equivalant in MySQL for:
-
Saving a command for later reuse.
eg: alias command1=’select count(*) from sometable;’
Where then I simply type command 1 to get the count for SomeTable. -
Saving just a string, or rather part of a command.
eg: select * from sometable where $complex_where_logic$ order by attr1 desc;
WHere $complex_where_logic$ is something I wish to save and not have to keep writing out
I found that the best solution for this is just any rich GUI for SQL queries (TOAD, mysql query browser, etc). They offer the ability to save commands and browse them and well, of course, much more.