I want to add a new column to a table in MySQL database that should get the value of another column in the same table. Is this possible? If so, how do you do it?
Thanks!
I want to add a new column to a table in MySQL database that should get the value of another column in the same table. Is this possible? If so, how do you do it?
Thanks!
Starting with MySQL 5.0.2 you can write a stored procedure linked to a TRIGGER
which can examine the new column each time a row is inserted, and automatically copy the other column's value into the new column if no value was supplied for the new column.
create a view, and you can select the same column twice and give it different name, then the application can use the view instead use the table directly.