I want to use with clause in order to shorten column names which will be used for calculations whenever I add with clause block of code to my SQL query it gives error: a column may not be outer-joined to a subquery, I’m not even using outer join, what’s the issue? Answer Didn’t test anything (just corrected the code) –