PL/SQL (MOSC)

MOSC Banner

Conflict between "min" function and "order by" clause?

edited Jan 17, 2013 9:06AM in PL/SQL (MOSC) 6 commentsAnswered
 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

Howdy, Stranger!

Log In

To view full details, sign in to My Oracle Support Community.

Register

Don't have a My Oracle Support Community account? Click here to get started.

Category Leaderboard

Top contributors this month

New to My Oracle Support Community? Visit our Welcome Center

MOSC Help Center