我在做:
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上使用工作台
谢谢!
答案 0 :(得分: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;
如果视图已经存在,那将取代视图。
答案 1 :(得分: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;
答案 2 :(得分:1)
添加以下内容:
create or replace view myview
as
select ....