Please start any new threads on our new site at https://forums.sqlteam.com. We've got lots of great SQL Server experts to answer whatever question you can come up with.

 All Forums
 General SQL Server Forums
 New to SQL Server Programming
 Help with View in SQL Oracle 10g

Author  Topic 

mitchnufc
Starting Member

2 Posts

Posted - 2011-04-02 : 06:54:29
I have 2 tables that I am trying to create a view from.

They are Customer & orderheader. The primary key in customer is cust_id and there is a foreign key in orderheader table under the column order_customer which references this.

I am trying to create a view that will return any orders that have taken more than 14 days to fufil here is my code:

create view excessivefull AS
select cust_firstname, cust_surname, order_id, order_date, order_completed
from customer join orderheader using (order_customer)
where order_completed - order_date >14
group by cust_firstname, cust_surname, order_date, order_completed;

when I try and run this I get an error sayingERROR at line 3:
ORA-00904: "CUSTOMER"."ORDER_CUSTOMER": invalid identifier

robvolk
Most Valuable Yak

15732 Posts

Posted - 2011-04-02 : 07:27:49
SQLTeam is a Microsoft SQL Server website. There's an Oracle forum you can try at http://dbforums.com/
Go to Top of Page

mitchnufc
Starting Member

2 Posts

Posted - 2011-04-02 : 09:03:42
Thanks
Go to Top of Page
   

- Advertisement -