1
I am trying to make an order by as the result of sql:
sql....
order by cod_rua,
case cod_lado
when 'M' then cod_lado desc
else cod_lado ASC
end, cod_altura
Only you’re making a mistake on the way down.
Guys didn’t work out:
order by
r.cod_altura, r.nr_rua,
(case when tb_confcamara.cod_lado = 'M' then r.cod_posicao) desc,
(case when tb_confcamara.cod_lado <> 'M' then r.cod_posicao)
Following Error:
Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Token unknown - line 21, column 60.
)
I am using Firebird.
If
cod_lado
for = ’M' you want to sort the descending column, if not increasing?– Marconi
Thiago, is reply of SO-En will help you, I just don’t know how it applies in Banco Firebird.
– Marconi