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.
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:
MySQL - Make an existing Field Unique
(7 answers)
Closed 9 years ago.
Is there anyway to make a column in mysql UNIQUE with out removing it and adding it again ?
I know how to add it but i would need to remove it first but i want to edit the current column and make it UNIQUE
I do
ALTER TABLE users
ADD UNIQUE (username)
But tells me that the column username is all ready there . When i want to edit it and not add it...
Could it be that the unique index is already there?
Could it be that there already are duplicates in that column?
Check MySQL - Make a Field Unique as it might fix your problem.
This question already has answers here:
Closed 12 years ago.
Possible Duplicate:
Alter MYSQL Table To Add Comments on Columns
Hi Guys,
I googled all over the place but I can't find the answer. I know you can add comments to your database columns. I already created a table but now i want to add comments to certain columns, my database programma (sequel pro) doesn't have a function to alter the columns with comments.
Is there an 'update' or 'alter' query to add comments to your columns? The database is in mysql.
Thanks!
UPDATE: found this. Now Trying if it's working
Just add
COMMENT "comment"
after your
ALTER TABLE xxx CHANGE xxx...