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...
Related
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.
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:
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:
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.