I'm trying to make an order by 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 are giving error in desc.
Staff did not work:
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)
Next Error:
Invalid token.
Dynamic SQL Error.
SQL error code = -104.
Token unknown - line 21, column 60.
)
I'm using Firebird.