Subject Re: [firebird-support] ORDER BY
Author Lucas Franzen
Cleber Amaral schrieb:
> Hello,
>
> how I do an order by in the following case unless error:
>
> select
> table1.contador,
> table2.Nome as NomeTable2
> from
> table1,
> table2
> where
> table1.cdTable2 = table2.contador
> order by
> NomeTable2 ASC
>
> When I use a "Alias" for table2.Nome
>
> Someone knows?

do yourself a favour and get rid off this outdated join syntax and use
an explicit join.

select
T1.contador,
T2.Nome asNomeTable2
from Table1 T1
[LEFT] JOIN TABLE2 T2 on T1.cdTable2 = T2.contador

order by
2 /* the second field (starting with 1, not 0!!!)

or

order by
T2.Nome

Luc.