Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/oracle/9.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Oracle 创建视图内部联接错误_Oracle_Oracle11g - Fatal编程技术网

Oracle 创建视图内部联接错误

Oracle 创建视图内部联接错误,oracle,oracle11g,Oracle,Oracle11g,我正在创建视图并使用内部联接,收到以下错误: ORA-00904: "B"."CUSTOMERNO": invalid identifier 这是我用来创建视图和内部联接的代码 CREATE VIEW RentalInfoOct (branch_no, branch_name, customer_no) AS SELECT b.branchNo, b.branchName, b.customerNo, c.customerNo FROM branch b INNER JOIN custome

我正在创建视图并使用内部联接,收到以下错误:

ORA-00904: "B"."CUSTOMERNO": invalid identifier
这是我用来创建视图和内部联接的代码

CREATE VIEW RentalInfoOct
(branch_no, branch_name, customer_no)
AS
SELECT b.branchNo, b.branchName, b.customerNo, c.customerNo
FROM branch b
INNER JOIN 
customer c
ON b.customerNo = c.customerNo
以下是创建表格命令

CREATE TABLE Branch
(
branchNo    SMALLINT    NOT NULL,
branchName  VARCHAR(20) NOT NULL,
branchAddress   VARCHAR(40) NOT NULL,
PRIMARY KEY (BranchNo)
);  

CREATE TABLE Customer
(
customerNo      SMALLINT    NOT NULL,
customerName        VARCHAR(15) NOT NULL,
customerAddress     VARCHAR(40) NOT NULL,
customerTel         VARCHAR(10),
PRIMARY KEY (CustomerNo)
);

为视图指定3列,但在select中选择4列,分支表上没有customerNo列。
CREATE VIEW RentalInfoOct
(branch_no, branch_name, customer_no)
AS
SELECT b.branchNo, b.branchName, b.customerNo, c.customerNo