Recently I attempted to add a column to one of the tables of my database which has 316 table but after the following command:
最近,我尝试在我的数据库中有一个表中添加一个列,这个表有316个表,但是在以下命令之后:
mysql> ALTER TABLE view_Server ADD rsh_protocol VARCHAR(60);
I get the following error :
我得到以下错误:
ERROR 1347 (HY000): 'itop.view_Server' is not BASE TABLE
all my searches was unsuccessful like using '``'
. So the question is that what's the reason of this error? and how can I git ride of that?
我所有的搜索都失败了,比如使用' ' ' '。问题是这个错误的原因是什么?我怎么能骑上它呢?
1 个解决方案
#1
3
From your "table" name, are you trying to add a column to a view?
从“表”名称中,是否尝试向视图添加列?
Run through each of these:
浏览每一个:
CREATE TABLE x (id INT, name VARCHAR(255));
INSERT INTO x VALUES (1, 'One');
INSERT INTO x VALUES (2, 'Two');
-- A view with no change of column names
CREATE VIEW y AS SELECT id FROM x;
SELECT * FROM y;
-- Change the view, again using the base table column names
ALTER VIEW y AS SELECT name FROM x;
SELECT * FROM y;
-- Change the view, switching column name from `name` to `theName`
ALTER VIEW y (theName) AS SELECT name FROM x;
SELECT * FROM y;
-- Change the view, switching column name to `anotherName` by aliasing in the SELECT
ALTER VIEW y AS SELECT name anotherName FROM x;
SELECT * FROM y;
#1
3
From your "table" name, are you trying to add a column to a view?
从“表”名称中,是否尝试向视图添加列?
Run through each of these:
浏览每一个:
CREATE TABLE x (id INT, name VARCHAR(255));
INSERT INTO x VALUES (1, 'One');
INSERT INTO x VALUES (2, 'Two');
-- A view with no change of column names
CREATE VIEW y AS SELECT id FROM x;
SELECT * FROM y;
-- Change the view, again using the base table column names
ALTER VIEW y AS SELECT name FROM x;
SELECT * FROM y;
-- Change the view, switching column name from `name` to `theName`
ALTER VIEW y (theName) AS SELECT name FROM x;
SELECT * FROM y;
-- Change the view, switching column name to `anotherName` by aliasing in the SELECT
ALTER VIEW y AS SELECT name anotherName FROM x;
SELECT * FROM y;