rank in descending order

Hello

How to select the rank of each record based on the value of the column in descending order

NO, THE VALUE

1 172

2 172

3 172

4 172

5 145

6 145

7 145

8 145

9 145

19 210

20 210

21 210

the output should be as below (210 rank #1, 172 rank #2, 145 rank #3).

19 210, 1

20 210, 1

21 210, 1

1 172, 2

2 172, 2

3 172, 2

4 172, 2

5 145, 3

6 145, 3

7 145, 3

8 145, 3

9 145, 3

You want to rank on the whole, not divided into subsets before ranking.

Also, since you want rows 1,2,3 without leaving space for repeated values, you want dense_rank:

Select dense_rank() over (order by value desc) "rank" no, the value of sheet1 value desc order;

Tags: Database

Similar Questions

  • Find all entries in address books and order in descending order

    I have an address book called Christmas. I don't seem to see the list of all my address books. When I find them I wish to see the names in descending order from a - z, please

    Open your address book.
    VIEW - put page to ensure that the two component directory and contact component is checked.

    Then select your address book, mode - SORT BY, and then select descending or ascending your preference.

    If this does not work, maybe download a picture of what it looks like to (smudge addresses for privacy).

  • Descending order to sort (Ascending vs.) Explorer

    I usually keep my directories sorted by file name.  If I have a directory sorted (in ascending order) and I copy to a new file and right click on the open space and choose ' sort by ', then 'name', it REVERSES the order of file!  The "Crescent" and "descendant" options are grayed out.  Note: She ALWAYS reverses the order.  If I first sort by name (for example it is now in ascending order) and then copy to a file and choose "Sorting nickname", in descending order.  Now, if I copy into another file and choose "Sorting nickname", is in the order of the CRESCENT.  Help!  It's embarrassing.  I suspect that a switch from adjustable to always sort in ascending order simple registry.  Or is there another problem?

    Instead of right clicking on an empty space, try clicking on the arrow next to the display of the toolbar button and select "Details", then click on the 'Name' column and there should be a small arrow above the column indicating the order in which it is in. If you do not get the idea and merges with what is ascendant and descendant, ascendant is sort of a to z and the descent is quite the opposite. Tell me if that does nothing :)

  • How can I sort the files in descending order & vice versa

    original title: files & folders

    How can I sort the files in descending order & vice versa

    The game, October 7, 2010 20:28:15 + 0000, phil7525 wrote:

    How can I sort the files in descending order & vice versa

    Make sure that you are in the Details view. Click on the heading of the field
    you want to sort. Click on it a second time to reverse growing
    descending, or vice versa.

    Ken Blake (MS-MVP)

  • My problem is: the photos are listed in descending order. I need them in ascending order.

    * Original title: Photo Arrangement

    I have a real problem with my understanding of photo.

    I am producing a slideshow on my travels in Asia over the period 2008-2015.

    All the photos are in individual folders by year. I also arranged their by the date.

    My problem is: the photos are listed in descending order.  I need them in increasing order - first photo of the last picture taken on a given date. Otherwise, I can't import individual files in my photoshow software because it displays the last picture taken 1.

    I can't find a link or an option to have this way.

    Does anyone know how to get the arranged in ascending order?

    Sunday, July 5, 2015, 13:51:46 + 0000, boongsongum wrote:

    I have a real problem with my understanding of photo.

    I am producing a slideshow on my travels in Asia over the period 2008-2015.

    All the photos are in individual folders by year. I also arranged their by the date.

    My problem is: the photos are listed in descending order.  I need them in increasing order - first photo of the last picture taken on a given date.

    With photos or anything else:

    You can sort the files in a folder by clicking on the header of the
    field you want to sort, such as the Date.

    You can reverse the sort order, down to bottom-up,
    or vice versa, by clicking on the header a second time.

  • Sort the list of open windows in descending order when windows are combined in the taskbar

    Sort the list of open windows in descending order when windows are combined in the taskbar

    I like to combine windows in order to access all my programs in the taskbar. I have tons of open Outlook messages that I need to respond to the last open order to open older. The problem is that the list of the oldest opened open again, and I have to constantly scroll to the bottom of this list to access the most recent message. Is there a way view the list by e-mail open newest to oldest?

    It would be a time saving of huge productivity for me, and I saw that many of my colleagues would benefit as well.

    Thanks in advance for your help.

    Sorry there is no function like that.

    You can consider using Outlook flags instead.  Arrival of emails, you will need to respond to, click the red flag on them.  They will appear in your Outlook ' to do' list so you can keep track of those you will have to answer to and check the power off when you are finished.

  • inner printing messages descending order of loop for

    Hi all

    Declare

    slider c_sender;

    slider c_receiver1;

    slider c_receiver2;

    Begin

    For c_rec in c_sender loop

    ....

    .....

    For c_rec1 in the c_receiver1loop (c_rec.param)

    dbms_output.put_line ('Entere1');

    End loop;

    For c_rec2 in the c_receiver2loop (c_rec.param)

    dbms_output.put_line ('Entered2');

    End loop;

    End loop;

    End;

    output

    Entere2

    Entere1

    Why printing messages like descending order

    and I need values such as

    Entere1

    and it's values related o/p


    Entere2

    and it's values related o/p


    How to do this? can you help me please?


    Please see my post update #9 (Test cases)

    Post edited by: Rajesh123 added on POST #9 Test cases

    If you need something like below

    SET SERVEROUTPUT ON

    DECLARE

    CURSOR c_1

    IS

    SELECT CODE_ID,

    HEADER_ID,

    ACC_DATE,

    ACC_CODE

    OF xxc_sender

    ORDER OF HEADER_ID, CODE_ID, acc_date;

    CURSOR c_2 (NUMBER, v_header_id NUMBER v_code_id)

    IS

    SELECT CODE_ID,

    HEADER_ID,

    po_id,

    ACC_CODE

    OF xxc_receiver_1

    WHERE CODE_ID = v_code_id

    AND HEADER_ID = v_header_id

    HEADER_ID ORDER, CODE_ID;

    CURSOR c_3 (v_code_id1, NUMBER v_header_id1)

    IS

    SELECT HEADER_ID, ACC_CODE, CODE_ID

    OF xxc_receiver_2

    WHERE CODE_ID = v_code_id1

    AND HEADER_ID = v_header_id1

    ORDER OF HEADER_ID, CODE_ID, trx_date;

    BEGIN

    Dbms_output.put_line ('enter the loop of the sender");

    DBMS_OUTPUT.put_line ('--------------------------------------------------------------');

    FOR c_rec IN c_1

    LOOP

    IF c_1% ROWCOUNT > 1 THEN

    DBMS_OUTPUT.put_line ('----------------------------------------------------------------');

    END IF;

    dbms_output.put_line ('Code Id is :'|| c_rec. CODE_ID |) » '||' AccCode :'|| c_rec. ACC_CODE);

    FOR c_rec1 IN c_2 (c_rec.code_id, c_rec.header_id)

    LOOP

    Dbms_output.put_line ('entered in the loop of Receiver1");

    dbms_output.put_line ('Code Id is =' | c_rec1.) CODE_ID | » '||' AccCode =' | c_rec1. ACC_CODE);

    END LOOP;

    FOR c_rec2 IN c_3 (c_rec.code_id, c_rec.header_id)

    LOOP

    Dbms_output.put_line ('entered in the loop of the receptor 2');

    dbms_output.put_line ('Code Id is =' | c_rec2.) CODE_ID | » '||' The header ID is :'|| c_rec2. HEADER_ID | »  '||' AccCode' | c_rec2. ACC_CODE | »  '||' AccCode123 :'|| c_rec2. ACC_CODE);

    END LOOP;

    -DBMS_OUTPUT.put_line (' ');

    END LOOP;

    END;

    OUTPUT:-

    =======

    anonymous block filled

    Enter the loop of the sender

    --------------------------------------------------------------

    Code Id is: AccCode:CGE 50

    Entered in the loop of Receiver1

    Code Id is = 50 AccCode = CGE

    ----------------------------------------------------------------

    Code Id is: 104 AccCode:ABSORPTION

    Entered in the loop of Receiver1

    Code Id is = 104 AccCode = ABSORPTION

    ----------------------------------------------------------------

    Code Id is: 395 AccCode: VALUE

    Entered in the loop of the receptor 2

    Code Id is = Header 395 id is: 126 AccCodeVALUE AccCode123: VALUE

    ----------------------------------------------------------------

    Code Id is: AccCode:RECE 105

    Entered in the loop of the receptor 2

    Code Id is = 105 Header id is: 128 AccCodeRECE AccCode123:RECE

    ----------------------------------------------------------------

    Code Id is: 395 AccCode:CGE

    Entered in the loop of the receptor 2

    Code Id is = Header 395 id is: 128 AccCodeCGE AccCode123:CGE

    Thank you

    Ann

  • first row and all rest in descending order query

    Hi all

    If I have a table with two columns

    ID country_name

    1 England

    2 China

    3 India
    4 the Japan
    5 canada
    so if I want to output where id 3 comes on the first row and all rest in descending order. What will be the query?


    Thank you


    Oracle Database 11 g Enterprise Edition Release 11.1.0.7.0 - 64 bit Production

    ...

    ORDER BY decode(id,3,1,2), id desc

    HTH

  • How to sort a table in descending order by default?

    Hi all

    I created a sample page that is research panel with table. His works well
    When searching in the table, I want to display the data in the table in descending order by default.
    For example, I have one of field's ID who's number I want to display the table in descending order.
    But we have an option that can be sorted and sort property in the behavior section. But if we want a default search, how to make.
    Can someone give a resolution?


    Thank you
    Shankar

    cant specify you desc order in the query in the t?

  • How to display the results of the database from several tables in descending order?

    I have a key word to search for images on my website that allows visitors to search for specific things. My db msysql has 15 tables and for the search function I use a UNION ALL operation to join them any visitor can find all tables at the same time. The problem is that all the results are in ascending order. How can I get the results in descending order.

    SELECT *.

    FROM table1

    Keyword WHERE AS id LIKE %s or %s

    UNION ALL

    SELECT *.

    FROM table2

    Keyword WHERE AS id LIKE %s or %s

    UNION ALL

    SELECT *.

    TABLE 3

    Keyword WHERE AS id LIKE %s or %s

    PS

    I tried this and it doesn't work:

    SELECT * FROM table1 WHERE AS %s or id AS %s ORDER BY id DESC keyword

    and I know that this is not conventional to use SELECT * with so many tables, but believe me, I have my reasons. I'm not trying to do is to wrap the whole UNION within an external SELECTION

    Once more, the order by clause can only appear at the end of the last select statement in a UNION query. You have it on all select statements.

  • Sort of a calculated field in descending order

    Hi gurus, Expert

    I have this code in BEEP to get the Total amount:

    <? xdoxslt:set_variable($_XDOCTX,'MRCTot',0)? >

    <? for-each: LINE? >

    <? xdoxslt:set_variable($_XDOCTX,'MRCTot',xdoxslt:get_variable($_XDOCTX,'MRCTot')+(MRC_ADD_PHP+MRC_DELETE_PHP+MRC_UPDATE_PHP))? > <? MRC_ADD_PHP + MRC_DELETE_PHP + MRC_UPDATE_PHP? >

    <? end foreach? >

    <? xdoxslt:get_variable($_XDOCTX,'MRCTot')? >

    Can you help me please how this sort in descending order.


    Kind regards
    Jean Paul

    You want to sort the LINE by (MRC_ADD_PHP + MRC_DELETE_PHP + MRC_UPDATE_PHP)?

  • Defining the column sort - descending order

    Hello

    I have the Period_Name column, which contains the month and year (for example. Dec - 06, Jan - 07...) and sort order is defined by another column 'end_date '.

    Due to this whenever I use the column 'Period_Name' in the command prompt, it gives me the period in ascending order. Now my requirement is to show the period in descending order. How can I make the setting to display in descending order?

    Kindly help.

    Kind regards
    Jitendra

    Use the order by columnname desc

  • How to program my incoming emails in descending order?

    I can't understand how to organize my incoming emails descending instead of the ascendant. Can someone help me with this?
    Don

    By clicking on a column header, which will be the primary sort column. Clicking the same header again will reverse the sort order. If you want to sort by date, click the DATE labeled header. Click on DATE for reverse sorting.

  • Get the emails in descending order of creation date. [REST API]

    Hello I am trying to GET emaiils of the REST API in order descending creation date. So far, my URL params look like:

    emails/assets /? Search = * BN * & page = 1 & number = 50 & depth minimum = & orderBy = converted

    This seems to put in ascending order. I wonder if I can specify the order? I noticed for the contacts there is a sorting = {sortOn} & dir = desc, so is it possible

    to do with e-mails? I tried to join the above URL & dir = desc but not luck and assuming that he only is not supported from this page http://topliners.eloqua.com/docs/DOC-3083.

    Yes I can reverse my logic in the program from the end of emails received, but I wonder if I can simply specify order emails using the REST API?

    Please let me know and thank you.

    Hi John,.

    To sort by a column name, such as the 'name' field, you can simply add the following query string parameters: & orderBy = name % 20desc

    The sort directions are: asc | / / DESC

    We will share a post soon to describe how to do this. The API should support the "dir" query string argument, but it doesn't seem to work. We will look into it as well.

    Hope this helps,

    Fred

  • How can I configure the Inbox for incoming mail in descending order of the list

    is there an easy way for me to put this right to present that are a list of my emails in no set order, his confusion and boring?

    By clicking on a column header will sort by that column. Clicking the same header again will reverse the sort order. Click DATE to sort by date.

Maybe you are looking for

  • New search suggestions is bloated with extra, non-utile space

    New search in Firefox 34A suggestions a lot of unnecessary bloat that makes me want to spend browsers. After switch it on Google as default search provider and by removing all other search engines so that they will not be displayed, I still have a us

  • downgraded to win 7 want win 8 on

    Hello I have a HP ENVY dv7-7332ea which I've demoted for win 7. Now, I decided to put windows 8 on. I changed the bios of the legacy of uefi support. When I boot from windows 8 dvd it starts to install and then wrote a requested media device driver i

  • PC update, security, firewall, burn CD, maintenance

    Helloa few queries:Problem: Internet is slow, web page not pop up take the time to pop up.What software do to update my PC, so I can get fast internet? I have MCAfee security, she also let know me if there's danger zone.What is fire walls, should I h

  • How to disable the annoying message "Printer cartridges no HP installed" on Windows 7?

    How to disable the annoying message "Printer cartridges no HP installed" on Windows 7? I have a HP Officejet 6500 has more and there is a way to disable those annoying pop ups. First of all, why HP can't fix their software to display only 1 message.

  • Limited to 20 Bluetooth pairing devices

    Hi all Our company is currently developing a bluetooth device you need to pair it with a mobile phone (blackberry included) and connect with the phone on a regular basis. The connection is short (only about 20 bytes of data sent) and then the device