Jump to content

SQL Queries


jakeyoung
 Share

Recommended Posts

:) Please Help.I am trying to create a view in SQL but when I execute it I get the following message ORA-00904: "INTEREST": invalid identifier I have put my code in below, maybe someone could point me in the right direction.Enter statements:create view InterestForm (Property, Address, Type, Price, aDate, SalesPerson, InterestLevel, Vendor) asselect Property_Number, vAddress_Line1, Type, Price, Appt_Date, sName, interest, vSurnamefrom Property, Sales_Staff, Vendor; select Property_Number, vAddress_Line1, Type, Price, Appt_Date, sName, interest, vSurname *ERROR at line 2: ORA-00904: "INTEREST": invalid identifier

Link to comment
Share on other sites

Out of curiosity, are you not joining on a particular field? As of right now, you are doing a join with a number of rows equal to (rows in Property) x (Rows in Sales_Staff) x (rows in Vendor), which unless all three tables are very small means your view is going to return a lot of rows. Just noticed and thought I would mention it.

Link to comment
Share on other sites

I am trying to create a view in SQL but when I execute it I get the following message ORA-00904: "INTEREST": invalid identifier ...select Property_Number, vAddress_Line1, Type, Price, Appt_Date, sName, interest, vSurname                                                                      *ERROR at line 2: ORA-00904: "INTEREST": invalid identifier

By the way, try this:
SELECT *FROM InterestForm

When you are trying to execute the view, you are not calling it properly. A view is essentially a new table as far as you are concerned (for querying purposes). The columns are: Property, Address, Type, Price, aDate, SalesPerson, InterestLevel, Vendorand the view is named InterestFormIn your query to execute the view, you did not list a FROM and you listed columns that are not in your view (at least not with those labels).I am not sure why it picked INTEREST to makr as invalid identifier, but oh well. Let me know if the above works and if you have any questions about it.

Link to comment
Share on other sites

By the way, try this:
SELECT *FROM InterestForm

When you are trying to execute the view, you are not calling it properly. A view is essentially a new table as far as you are concerned (for querying purposes). The columns are: Property, Address, Type, Price, aDate, SalesPerson, InterestLevel, Vendorand the view is named InterestFormIn your query to execute the view, you did not list a FROM and you listed columns that are not in your view (at least not with those labels).I am not sure why it picked INTEREST to makr as invalid identifier, but oh well. Let me know if the above works and if you have any questions about it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...