Question:
I’m trying to use an alias inside a subquery in a select statement like the one below:‘Invalid column name ‘InvoiceAverage’.
Answer:
No need for a subquery here, use windowed aggregates:If you have better answer, please add a comment about this, thank you!