Skip to content
Advertisement

How to order a SQL statemnet according to alias name

I have the next SQL statement:

I want to order it by FinalTotal, I tried to put :

but it doesn’t be affected.

how I can sort it? and please note that I tried many solutions on the internet but without result. thanks advanced

Advertisement

Answer

The fail-safe solution is to place the whole query as a table expression to produce the column name, and then sorting is trivial.

For example:

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