Is there a way to add a column to an existing view in mysql?

For a table, I can do like this:

ALTER TABLE table_name  
ADD column_name datatype

but this does not apply to the existing species. I wonder if there is a way to solve this?

+5
source share
1 answer

Use the Alter View statement to edit the view. Just use the existing SQL statement in the current view and add the column to the end.

http://dev.mysql.com/doc/refman/5.0/en/alter-view.html

A more detailed explanation than the actual documents can be found here:

http://www.roseindia.net/mysql/mysql5/views.shtml

Edit - Added

. , , .

: - . .

, , , , , , . , EmployeeId, FirstName LastName...

, :

Create View FullNames AS
Select EmployeeId, firstname + ' ' + lastname AS FullName from Employees

, - FullName. . , , DB -.

+7

All Articles