Skip to content
Advertisement

Oracle SQL Error : Unable to execute Subquery

I am trying to execute below Oracle SQL query

But keep getting error like

Any idea what I am missing

Advertisement

Answer

If you use double-quotes when you define an alias like "Region" (which you should never do!), the alias becomes case-sensitive. When you reference m.region, that is not in double-quotes, the column name is automatically converted to upper-case REGION, which does not match Region.

Just don’t use double-quotes around the aliases in the query and this problem will be cured. I didn’t check the rest of the query to see if you will run into additional errors.

Alternatively, you could use m."Region" everywhere (in double quotes). Bad practice!

User contributions licensed under: CC BY-SA
9 People found this is helpful
Advertisement