Skip to content
Advertisement

SQL invalid Identifier query

I am getting an error that grandvisit is an invalid identifier, and I am unsure if I will get it with other identifiers either. Any light shed on this would be amazing. As I cannot see why it differents from others.

Advertisement

Answer

You cannot refer the alias names in same select clause where it is generated.

To calculate grandratio you are using the below expression which uses the alias name grandvisit

You can use derived table to do this

Note : You are using old style outer join’s(+=). It is better to use Right/Left joins which is more readable

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