I want to make an alias(as in bash) for the following MySQL query:
SHOW COLUMNS FROM table WHERE Field != 'col_name' AND Field != 'col_name';
I read something about views but it seems that I need a SELECT query to use them.
I want to type only something like: showcols in the MySQL prompt and in the background the above query to be executed, is that possible?
PS: I cannot use DESCRIBE because of the length of some enum fields in the table.
You can replace the
show columnswith aselectfrom theinformation_schemadatabase.Now you can create a
viewbased on this select: