Order based on the particular values

Hello

Here is an example of data from the table I,

ID CAT_DESC OVERDUE_DAYS

1 DEPOSIT 45

1 DEPOT 48

10 FT 30

10 FT 40

10 FT 50

1 DEPOSIT 40

2 45 LOAN

2 43 LOAN

2 LOAN 40

My request here is to show records with CAT_DESC = "Pi" FIRST and then sort the another recordset based on the OVERDUE_DAYS DESC.

I tried the query below and I do a sort, showing all records in FT first with overdue_days desc, and other records also sorted by the column ID of the rest...

Select * from test_order

order by case when id = 10 then 1 else 2 end, id, overdue_days desc;

The result retrieved is

IDCAT_DESCOVERDUE_DAYS
10FT50
10FT40
10FT30
1DEPOSIT48
1DEPOSIT45
1DEPOSIT40
2LOAN45
2LOAN43
2LOAN

40

BUT THE RESULT I WANT IS

IDCAT_DESCOVERDUE_DAYS
10FT50
10FT40
10FT30
1DEPOSIT48
1DEPOSIT45
2LOAN45
2LOAN43
1DEPOSIT40
2LOAN40

Help, please... Is this feasible?

.. Deleted...

Try

Select * from table_t

order by case when id = 10 then 1 other end null, overdue_days desc, cat_desc

Tags: Database

Similar Questions

  • based on the prompt value see the FDF anayasis

    Hello

    I have a situation like this
    I use obiee 11g

    Based on the prompt value in him would like to show 3 different analayses.
    I mean that if the value of guest in the page has as abc data it should show the anlaysis1
    If the prompt value data as def it should show the anlaysis2
    If the prompt value data as the IGS, it should show the anlaysis3
    If the prompt value data as jkl it should show the anlaysis3

    Why 3 diff analysis is because I have my list 2 columns in each anayaiss and they are 3 different tables.

    One more thing

    Obiee do we have a show and a return value for a radiobutton/drop-down list. As show us abc how invites and returns 1. is possible?

    Thank you

    Published by: user123 on July 12, 2011 12:29

    You can have n number of reports, simply use the union all in the dash prompt sql results and this will give you the choice to select any report you want.

  • How to find the bpel instance in 11 g based on the index values

    We have 10 GB BPEL processes where we define the 4 index values for all instances. Whenever the support request comes, ask us the values of index and based on what we're looking for the process instance.

    We have now migrated bpel 10g and 11g process. How to find the bpel instance in 11 g based on the index values?

    You can go there. http://soasphere.blogspot.com/2011/04/how-to-Serch-composites-for-index.html. Do a join on the cube_instance and ci_indexes tables.

  • void / vi based on the Boolean value

    Hello

    I have a main vi and I want to call a subvi based on a Boolean value, that is when the Boolean entry gets the true value, the sub - vi must run, otherwise it shouldn't.

    To do this, I added the Boolean control component connector of the sub - vi and I added a while loop in the sub - vi, which has 'continue if true' condition. I also made this point prescribed to the subvi.

    However, I noticed that even if the Boolean value false maintains execution of the sub - vi.

    Can you get it someone please let me know what the problem with this approach?

    Thank you

    Despres

    Put the Subvi code (or the Subvi set) inside the true case of a case structure and wire your boolean to that.  I prefer the second option.

  • Change the text displayed, based on the threshold value

    Hi users of Labview,.

    I need help with display and editing text in labview.

    The text should display and change according to the following conditions:

    0 volt - "no power".

    1 volt - "controller ON".

    2 Volt - "Rotor Running"

    3 volt - "Rotor stopped".

    Based on the voltage read by the channel, the text must be displayed and modified on the same area of the front panel. For example, initially it will be 0 Volt and the text "No power" should appear as an indicator of text (and not as a warning message). He needs to change ' controller we ' when the chages of voltage from 0 to 1 volt. The canal reads the analog input voltage (range 0 - 5V).

    I'm relatively new to labview. So please give me pointers or from suggestions on how can be done. Any help is greatly appreciated.

    Thank you

    REDA

    Hello

    Thanks for the crossrulz of notes, have not used the front threshold.  For this simple example, it is "symmetrical", but I can see how the values in the table have been does not correspond to the index position that is so true useful.  Learn something every day, I could not resist, wanted to try.

    OK, here's a sample VI that puts a custom message based on the crossing of a threshold.  Home work is to study the components before asking to :-)

    The dice are the analog signal of 0 to 6.   He rounded to the whole number to provide the index number.  Power is the index number in the index table, the table being hard-coded text messages.

    Two additional indicators may be deleted, useful to see what is happening.

    And get rid of the value 0 if you want the text to match the number, he he he

    Enjoy.

  • ListView, title change to header based on the stored value.

    Hello

    I'm new to native development, always trying to get a hang of how things are done in QML. I was wondering how it was possible to format the header in the ListView based on the value of the header. For example, the datamodel is sorted by name and status. Status is stored as an integer 0,1,2,3,4,5 in the database. Whenever the ListView displays the headers, I want to show the actual title of the State (for example in progress, completed) instead of display 0 or 1.

    Thank you for your help.

    If... else if... else must have worked well, please send your code.

  • Increment sequence based on the existence value

    Hello

    I have a requirement,
    I need the value sequence based on the values exist in the database.
    Let me explain with an example of a column, I have values such as 1,2,3,4,5,6,7,8,10,12,14, etc...

    Here I have to generate the value of the sequence 9,11,13 follows...


    Logically it please suggest me... I try with While loop I could not reach again.

    We want to help you.

    Concerning
    Rambeau
     select  level missing_values
       from  dual
       connect by level <= (select max(your_column) from your_table)
    minus
     select  your_column
       from  your_table
    /
    

    For example:

    with t as (
               select level n from dual connect by level < 9 union all
               select 10 from dual union all
               select 12 from dual union all
               select 14 from dual
              )
    -- end of on-the-fly data sample
     select  level missing_values
       from  dual
       connect by level <= (select max(n) from t)
    minus
     select  *
       from  t
    /
    
    MISSING_VALUES
    --------------
                 9
                11
                13
    
    SQL> 
    

    SY.

  • PARTITION OF? Returns an identifier based on the minimum value of another column

    Hi guys

    I want to return the ID column of a line, where 2 other columns = a value set, and a 3rd column has the minimum value corresponding to the other criteria.

    so, indeed:

    with t as (
    select 1 dst_id, 'abc' dst_title, 1 edition_from, 1 media_item from dual 
    union all 
    select 2 dst_id, 'abc' dst_title, 1 edition_from, 2 media_item from dual 
    union all 
    select 3 dst_id, 'abc' dst_title, 2 edition_from, 1 media_item from dual 
    union all 
    select 4 dst_id, 'abc' dst_title, 2 edition_from, 2 media_item from dual 
    union all 
    select 5 dst_id, 'def' dst_title, 1 edition_from, 1 media_item from dual 
    union all 
    select 6 dst_id, 'def' dst_title, 1 edition_from, 2 media_item from dual 
    )
      select dst_id
      from t
      where dst_title = 'abc' 
      and edition_from = 1
      and media_item = minimum value of media item using above where clause
    Return dst_id = 1 because it has the value point minimum media 1 where dst_title = abc and edition_from = 1

    Is this possible in 1 query? I tried using partition and on dst_title, edition_from, but it does not work.

    I am currently using a query sub or 2 queries, but think that there must be a way to do it in a?

    Thank you all

    Scott

    pus

    with t as (
      select 1 dst_id, 'abc' dst_title, 1 edition_from, 1 media_item from dual union all
      select 2 dst_id, 'abc' dst_title, 1 edition_from, 2 media_item from dual union all
      select 3 dst_id, 'abc' dst_title, 2 edition_from, 1 media_item from dual union all
      select 4 dst_id, 'abc' dst_title, 2 edition_from, 2 media_item from dual union all
      select 5 dst_id, 'def' dst_title, 1 edition_from, 1 media_item from dual union all
      select 6 dst_id, 'def' dst_title, 1 edition_from, 2 media_item from dual
    )
    select min(dst_id) keep (dense_rank first order by media_item) as dst_id
    from t
    where dst_title = 'abc'
    and edition_from = 1
    ;
    
  • Conditional display in the text box based on the calculated value

    Hello

    I have radio buttons that each have a numerical value. For example = 1 A = 2 C = 0. In the example below, the total is equal to 5.
    examplescreen01.gif

    The sum is displayed at the bottom of the document and is passed to another text box:

    examplescreen02.gif

    Instead of '5' displayed in the text box on the right, it should display a "Control" Word like this:
    examplescreen03.gif

    The displayed word is based on the totals through this range:

    1-2 = 'absorbing '.

    3-4 = 'practitioner '.

    5 to 6 = "control".

    The script I used to pass the value from the left to the right text box in the chart above is:

    name of the field to text box;

    var cTextBox = 'Cabinet Talent strategy knowledge - total';

    get the value of the field with the name in cTextBox;

    var sTextBox = this.getField ("cTextBox") .value;

    Set the value of this field;

    Event.Value = sTextBox;

    That I need to add to this script to show one of the words, such as "control" above?

    I am a complete novice to scripting. I found the above script online and somehow got it to work.

    I thank very much for any help or pointers, you can provide.

    Best regards

    Chris

    Sorry, there were some errors in the code that I provided above. Try this:

    If (sTextBox > = 1 & sTextBox)<= 2)="">

    Event.Value = "absorbing";

    } ElseIf (sTextBox > = 3 & sTextBox)<= 4)="">

    Event.Value = "practitioner";

    } ElseIf (sTextBox > = 5 & sTextBox)<= 6)="">

    Event.Value = "master";

    } else {}

    Event.Value = "";

    }

    If it still does not respond, you can send me the file at [email protected] and I'll check...

  • Make visible subform based on the dropdown value

    I use this script successfully.

    Form1. #subform [0]. typeOfIncidentDdl::change - (JavaScript, client)
    assocInfoSubform.presence = 'hidden ';
    custInfoSubform.presence = 'hidden ';

    If (xfa.event.newText == "associate injuries") {}

    assocInfoSubform.presence = "visible";


    } else {}
    custInfoSubform.presence = "visible";

    }

    But I would like to know how can I use numeric values in the object palette instead. For a drop-down list in the object > tab link, I click on the checkbox 'specify item values', where the values are, by default, the numbers, and the text is something I've specified in the tab field under "Items in the list." What is the syntax for the use of these numerical values instead of text? Here's what I tried without success.

    If xfa.resolvNode(form1.#subform[0].typeOfIncidentDdl).value = "1"; {
    [fields become visible and required with error messages]


    } else {}
    [fields are hidden and not required]
    }

    And this:

    var oSubform = xfa.resolveNode("form1.#subform[0].typeOfIncidentDdl.Value");
    If (oSubform = 1); {

    etc.

    And this:

    var oSubform = xfa.resolveNode("form1.#subform[0].typeOfIncidentDdl.rawValue");
    If (oSubform = 1); {

    etc.

    I need to be close, but I don't quite have the correct syntax. Thank you for pointing me in the right direction.

    Hello

    Good man Jono, I cracked switch statements based on his examples

    I suspect that this is part of the reverse lookup that explained Paul.

    My understanding (now):

    • xfa.event.newText is the new value, but it is not yet fully committed to the value of the drop-down list.
    • With the help of this.boundItem (xfa.event.newText); you use this newly modified (but not yet posted) value and it controls against known display items.
    • The switch statement then uses this display element, rather than the uncommitted newText.

    I still think I have uses the event exit and rawValue, but "if it ain't broke, don't fix it!"

    Good luck

    Niall

  • Popup is not refreshing based on the current value of the row in a table

    Hi all

    1.I have created an entity object View for the Table Emp

    2. then I created an editable view object based on the EMP table

    3. create a Page like jspx

    4 drag and drop the View object as read-only Table in this homepage

    5 drag and drop the view even object as in this homepage

    6 goto the shape and dressing with Popup

    7. then create a dialog inside the pop-up window

    8. then, go to the Table and then surround with a collection of panels

    9. create a button in the toolbar of the collection Panel name it as edit

    10. drag and drop the showpopupbehaviour the button change

    When I run the application. It displays all records in the emp table. If I'm in line 6. It shows the values of line 6 in the pop-up window, but if I moved to the next line which is the 7th and then press the button to change is to always show the 6th place of the values only.how to display the values in the pop-up window based on the cursor line .pls guide me in this.

    Thanks in advance
    C.Karukkuvel

    Hello

    Make sure you use contentDelivery = "lazyUncached" in the context menu

    Gabriel

  • Passing DB values to the text based on the Select Value box

    Hello

    I'm very big thing back to the Oracle APEX. In my project, I have a requirement in which I need to pass different values for the corresponding text boxes on a different page based on the value I select in the item "Select Value".

    I tried using processes calling for demand, but could not get the desired result.

    Please suggest!

    Hello

    Can you repeat your scenario on apex.oracle.com? It will be easier to fix it this way.

    Kind regards

  • Offshoot of page based on the return value of function

    I have a combo box (P2008_SUPPORTING_MATERIALS) with 'Yes' and 'No' values.

    I need a button that will save the selected value, and then create a branch to the 1092 page if it of 'Yes' or branch to page 2094 if it is 'no '.

    That's what I did:

    1 create a SAVE button
    2. created a page process of type PL/SQL with function (see code below) inside (PageBranchDecision). The conditional processing I put him "when press button" for the "SAVE" button.
    3. create a branch of the page with a branch type of DIRECTION to the FUNCTION RETURN A PAGE. For the action of the branch, I put the name of the procedure on the page (PageBranchDecision). Because these are conditions, I defined him "when press button" on the "SAVE" button.

    This is the code for the page process:

    DECLARE
    whole n_page_id;
    v_sup VARCHAR2 (3);

    BEGIN
    v_sup: =: P2008_SUPPORTING_MATERIALS;

    IF v_sup = "Yes".
    THEN
    SELECT 1092 INTO double n_page_id;
    RETURN n_page_id;
    ON THE OTHER
    SELECT 2049 INTO double n_page_id;
    RETURN n_page_id;
    END if;

    END;

    Now, that's the problem... According to the 'Oracle HTML DB manual"page 294 books and ' easy Oracle HTML-DB' page 307, with the type of the branch of 'Branch to function returning a Page', a function PL/SQL is written which returns a digital page at junction id. In my code, it would be 'n_page_id '. But, when I run my page and click on my "SAVE" button I gives me an error that a RETURN statement cannot contain an expression.

    I don't know why I get this error. I need to get the value of the page to the branch based on the 'yes' or 'no '.

    Someone has an idea what I am doing wrong? My situation seems, as it is possible through the logic, I'm following?

    Thanks in advance,
    Maggie

    ch - ensure that any unconditional branch on the page has a largest number in sequence to ensure that this branch is triggered and ensure that there is no other branch that is triggered by the "SAVE" button

  • Dynamically set a value based on the selected value of LOV

    Apex 4.2

    I can't create a dynamic action to set a value. I have used dynamic actions to hide and display areas but for some reason any cannot set a value.

    I have a list of selection-> P101_LIST. Type of source is "Column of the database". Source of value or an expression is "person_id" the query is as follows:

    Select first_name, person_id
    From Persons
    

    I have a display-> P101_DISPLAY value. Source type is 'static Assignment. The source value or expression that I left blank.

    I would like for each time the user selects a name of P101_LIST, the P101_DISPLAY element is updated to display the value (person_id) correspondent.

    Because there are other page elements / information on the page, I prefer that to not submit / update of the page. Would not want other page elements / information update.

    Any help on this would be greatly appreciated. Thanks in advance.

    Hello

    Create a DA:

    -event onChange P101_LIST

    -Action: PL/SQL

    -PL/SQL code:

    : P101_DISPLAY: =: P101_LIST;

    What to submit: P101_LIST

    Point of return: P101_DISPLAY

    And in fact.

    Kind regards

    Joni

  • Ask in the dashboard as link can filter based on the prompt values?

    Hi all

    In a dashboard, in a section using the prompt of commands and other section with the image object or the link and the given path was for a query created in the responses. The dashboard looks like a prompt command and below the link to the application.

    If I enter the prompt value, click on the link-> the pop up window and view the report but does not filter the data according to the prompt value.
    So, it is possible to do like that? If it is please share how to do this?

    Thanks in advance!

    Do not use the link or Image. Use the Guid. NAV. oppose instead. Link or Image may open in a new window, but the guests are not passed. GUID. NAV. object passes guests, which is what you want, but can not open in a new window.

Maybe you are looking for