Reference: Group By/Order By syntax

Description:

For Group By clause, you can't use column alias. Instead, use column index numbers.

For Order By clause, generally, you can use alias or index numbers. But there is one special case. If the Order By clause uses UDFs, then using column index number doesn't work. So, in case of columns, which have function values, use column alias. In rest of the cases, you can use either column number or alias.

Have more questions? Submit a request

Comments

Powered by Zendesk