NOT LIKE not working with SHOW [duplicate] - mysql

This question already has answers here:
mysql: What is the right syntax for NOT LIKE?
(3 answers)
Closed 6 years ago.
SHOW TABLES NOT LIKE 'wp_2_%'
this sql query is not working for me

You can't use not like directly in a show tables statement, but you could put it in a where clause:
SHOW TABLES WHERE tables_in_db NOT LIKE 'wp_2_%';

Yes, and it shouldn't work. SHOW TABLES simply does not allow using NOT like that.
http://dev.mysql.com/doc/refman/5.7/en/show-tables.html

Related

Understanding 3 parameters in MySQL workbench Code Editor settings [duplicate]

This question already has answers here:
Are table names in MySQL case sensitive?
(5 answers)
Delimiters in MySQL
(4 answers)
How can I see the specific value of the sql_mode?
(3 answers)
Closed 2 years ago.
What do the following three settings mean in MySQL Workbench?
These three parameters are mentioned briefly on the General Editor Settings, but I'm wondering what might be an example of their usage. For example:
SQL Identifiers are Case Sensitive: Enabled by default. Whether to treat identifiers separately if their names differ only in letter case.
Does this mean, for example that:
SELECT * from main_iteminstance
is different from:
SELECT * FROM main_iteminstance
The answer is no when I tried both, but isn't FROM a sql identifier, so what would this setting mean exactly?

What is the effect of having empty tables in your database? [duplicate]

This question already has answers here:
Unused Database Table Effects
(5 answers)
Closed 3 years ago.
I have a few temporary tables that I use for a second, then clear out the data. Should I delete these tables after I finish using them or would it be okay to leave them?
It is OK to leave them.
You may wish from time to time to check the file size and run a Compact & Repair.

how to add comment to existing view in mysql [duplicate]

This question already has answers here:
Create comments for views in mysql
(4 answers)
Closed 6 years ago.
I want to ask you how add comment to view ( not table ) in MySQL. I tried something like this:
ALTER VIEW VIEWNAME COMMENT comment
but this not working.
You have to script the entire view, add the column to your query, and execute the change. You can't just add a field to the view like you would a table because it doesn't know where it should come from.

List of views in mysql [duplicate]

This question already has answers here:
How to get a list of MySQL views?
(9 answers)
Closed 8 years ago.
I created some views in mysql but I don't quite remember their names. Is there a way to look them up as you would a table, i.e. (show tables;)?
This is a duplicate question with an answer
SHOW FULL TABLES IN database_name WHERE TABLE_TYPE LIKE 'VIEW';

How do I make a query return nothing when there are no conditions? [duplicate]

This question already has an answer here:
Closed 10 years ago.
Possible Duplicate:
How do I make a query return nothing when there are no conditions?
If I have a query,I don't want any results returned when it isn't provided with any WHERE clause information.
In simpler terms, how do I make a query non-greedy?
I think this would do the trick for you:
SELECT *
FROM Table
WHERE 1=0
OR (some other criteria)