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.
Related
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
This question already has answers here:
Additional tables in WordPress database
(2 answers)
Closed 8 years ago.
Is there any reason not to add a few tables to the WordPress database? I'm not too familiar with WordPress and wouldn't want all that data to get flattened if WordPress was updated or anything like that.
You can add tables to your database without any issue. WordPress will leave any custom tables untouched with updates.
I would ask yourself if the new table is really necessary. For example. If the new data really should just be a WordPress custom post type and stored in wp_posts. Or maybe stored in the meta tables.
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';
This question already has answers here:
remove all numeric characters from column mysql
(2 answers)
Closed 9 years ago.
I have millions of data in MySQL table, now I need to update one particular column of the table with only non-numeric characters. That is I need to remove all numbers from that column. The row wont be deleted, only updated with only non-numeric values.
I need some efficient way to achieve this.
Calling 10 times replace doesn't look good.
Thanks,
Ashish
For mysql, you just have to replace everything:
Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(Replace(column,'9',''),'8',''),'7',''),'6',''),'5',''),'4',''),'3',''),'2',''),'1',''),'0','');
This question already has answers here:
Closed 10 years ago.
Possible Duplicate:
mysql auto_increment by 5?
I have a table that will have a column that needs to have a primary key. I want to set it to auto-increment, but it should increment by 5 or 10. I have been searching it, but it is hard to find the resource.
Does anybody know how to do it?
Thank you.
There is a server configuration setting called auto_increment_increment. Note however that this will be for all tables.