0

我正在做 :

create view WritersCouples as
select researcher.serial_number as S1, researcher.firstname as S2
from researcher, researcher as rs
where researcher.serial_number <> rs.serial_number;

我收到以下错误:

Error Code: 1050. Table 'WritersCouples' already exists

我在 mySql 上使用工作台

谢谢 !

4

3 回答 3

4

添加以下内容:

create or replace view myview
as
select ....
于 2012-12-31T18:34:42.330 回答
1

您是否已经创建了视图?或者你已经有一个名为的表WritersCouples

你可以试试这个:

create or replace view WritersCouples as
select researcher.serial_number as S1, researcher.firstname as S2
from researcher, researcher as rs
where researcher.serial_number <> rs.serial_number;

如果视图已经存在,它将替换视图。

于 2012-12-31T18:33:49.463 回答
1

如果视图已经存在,添加OR REPLACE子句:

create OR REPLACE view WritersCouples as
select researcher.serial_number as S1, researcher.firstname as S2
from researcher, researcher as rs
where researcher.serial_number <> rs.serial_number;
于 2012-12-31T18:34:21.497 回答