How can I get the maximum salary of the first ascending

Hello

How can I get the maximum salary of the first in ascending order.
I need the sql query.

want my output:

Emp_name salary
A 5000
SS 100
300 AA
DD 700
WW 2000



Thank you
Walid.

Here is an example:

SQL> with mytable as
  2  ( select 'aa' as col1,  300 col2 from dual union all
  3    select 'ss' as col1,  100 col2 from dual union all
  4    select 'a'  as col1, 5000 col2 from dual union all
  5    select 'dd' as col1,  700 col2 from dual union all
  6    select 'ww' as col1, 2000 col2 from dual )
  7  select col1, col2
  8  from   mytable
  9  order by decode(row_number() over (order by col2 desc),1,0,1),col2;

CO       COL2
-- ----------
a        5000
ss        100
aa        300
dd        700
ww       2000

SQL>

Nicolas.

Tags: Database

Similar Questions

Maybe you are looking for

  • I forgot my administrators password to enter my computer hp beats audio laptop

    I need to enter my computer, I changed my password for administrators because of my boyfriend had a coupke drinks and I forgot my password

  • Reports of test bench is more generated

    Somewhere during development stopped reporting occurs. I received them very well until the end of last week. I looked at all the obvious things, but I was not able to solve the problem. I looked at the menu: "configure the report Options >" and he se

  • XP - Crash after installing the update 02/08/10

    My computer crashed when it restarts on the 02/08/10 update security installation.  It goes to the Windows XP screen works for about 5 minutes and restarts.  After a dozen or so times he finally entered the File Check but only gets to the end of part

  • The failure of the Installation Windows 10

    I have an Acer V 17 Nitro Black Edition (VN7 - 791-G) I tried more than 10 times to upgrade to Windows 10. Using the application (said I was ready to be upgraded) using a USB Microsoft Media creation tool installation disc. I tried to update each tim

  • Aspire 5755G - 9417 larger capacity hard drive

    Aspire 5755G - 9417 current (original) HD is 1 TB. I'm looking to replace it with a larger. Can I use one to 1.5 or 2 TB of HARD drive in this unit or is there a restriction on the ability? Also, the initial height of the disc is 12.5 mm. It seems th