For example I use this
select * from tab1;
every 5 minutes.
Is there a way to set up an alias p so that I can just do
p
instead and that query is executed?
This calls for a view, but in your case it isn't much shorter:
create view p as selecT * From tab1;
You'd use it as: select * from p
It does get more interesting with more complex queries though.
You can create a stored procedure and then call it like CALL p.
http://dev.mysql.com/doc/refman/5.1/en/stored-routines.html
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With