SQL Question

0 pts.
Tags:
Oracle
I am migrating a query from MySQL to Oracle 9i. The query returns the error: ORA-00904: ?Y?.?CATEGORYID?: invalid identifier error message. Which means the column name entered is either missing or invalid. The SQL is below, if anyone can help me resolve this problem, your assistance would be greatly appreciated. SELECT company.name,company.companyid,company.duns, x.NAME, x.categoryid, y.NAME, y.categoryid FROM ((company join (category industry join ref_category x on industry.categoryid = x.categoryid) on company.companyid=industry.companyid and x.ParentID=0) join (category join ref_category y on category.categoryid = y.categoryid) on company.companyid=category.companyid and y.ParentID=x.CategoryID) WHERE NOT EXISTS (SELECT * FROM category subcategory JOIN ref_category z ON subcategory.CategoryID = z.CategoryID and company.CompanyID = subcategory.CompanyID and z.ParentID = y.CategoryID)
ASKED: March 10, 2005  11:27 AM
UPDATED: March 11, 2005  10:33 AM

Answer Wiki

Thanks. We'll let you know when a new response is added.

in your WHERE clause there is a subselect that references a column y.CategoryID. the qualifier ‘y’ is not defined in that subselect or in the outer select. You have it defined in a subselect in the FROM clause and that definition is not global.

Discuss This Question:  

 
There was an error processing your information. Please try again later.
Thanks. We'll let you know when a new response is added.
Send me notifications when members answer or reply to this question.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Forgot Password

No problem! Submit your e-mail address below. We'll send you an e-mail containing your password.

Your password has been sent to:

To follow this tag...

There was an error processing your information. Please try again later.

REGISTER or login:

Forgot Password?
By submitting you agree to receive email from TechTarget and its partners. If you reside outside of the United States, you consent to having your personal data transferred to and processed in the United States. Privacy

Thanks! We'll email you when relevant content is added and updated.

Following