Conflict between "min" function and "order by" clause?
Why it's happens?
For "min" function 'IMPEDIMENTO' < 'IMÓVEL', in the contrary for "order by asc" clause 'IMPEDIMENTO' > 'IMÓVEL'.
-- min function: 'IMPEDIMENTO' < 'IMÓVEL'
select min(plv) from (
SELECT 'IMÓVEL' plv from dual union
SELECT 'IMPEDIMENTO' plv from dual
)
IMPEDIMENTO
-- order by clause: 'IMPEDIMENTO' > 'IMÓVEL'
SELECT 'IMÓVEL' plv from dual union
SELECT 'IMPEDIMENTO' plv from dual
order by plv asc
IMÓVEL
IMPEDIMENTO
0