How to sort the result

The pk of a table type is varchar2. It is composed of the number and the string, for example GD_345, GD_1123, GD_567.
If I use the order of term, the result is as follows:
GD_1123
GD_345
GD_567

However, I need to get the result as follows
GD_345
GD_567
GD_1123

How wirte SQL script?
Thank you very much!

Hey YOU,.

As it is the Varchar2 column Type and it is composed of Alpha - numeric characters. Try to extract the numerical value of the string.

Try this.

SELECT   *
    FROM TEMP_VAR
ORDER BY TO_NUMBER (SUBSTR (VAR, INSTR (VAR, '_') + 1)) ASC;

If you are not sure of previous characters '_', you can also use this query.

Thank you
Shankar

Published by: Viji Shankar on May 30, 2012 21:10

Tags: Database

Similar Questions

  • How to sort the search results on several critiria

    We use 10gr 3 of the Complutense University of MADRID and on our search results page would like to sort the results returned based on several criteria. For example, first sort us on a field with possible values 1-9, then sort by modified date.

    Currently, we have:

    <!-$ SortField = "xCustom"->
    <!-$ SortOrder = "DESC"->
    <!-$executeService ("SS_GET_SEARCH_RESULTS")->
    But it seems that if I place another set of these as:


    <!-$ SortField = "xCustom"->
    <!-$ SortOrder = "DESC"->
    <!-$ SortField = "dInDate"->
    <!-$ SortOrder = "DESC"->
    <!-$executeService ("SS_GET_SEARCH_RESULTS")->

    The sort will be performed just on the second set.

    I found sortspec, but where example it returns results when you use the following is not:

    <!-$ SortSpec = "dInDate DESC DESC xCustom"->
    <!-$executeService ("SS_GET_SEARCH_RESULTS")->

    Does anyone have experience with this?

    I thank in advance.

    I think you have the syntax for this evil. It is rather SQL than anything

    for example

    OR

    Have you watched the MultiSort component?

    http://www.Oracle.com/technetwork/middleware/content-management/Multisort-10G-134216.zip

    Hope you're going to get

    Tim

  • Nested no uid in result of server really not necessary to sort the results. What does that mean?

    When I try to access my Inbox for outitgoes webmail, I get a message saying nested no uid in result of server really not necessary to sort the results. I can connect fine and records, sent access etc, but not my Inbox, what someone has any ideas how to solve this problem? Thank you.

    If the webmail, it cannot not be IMAP.  Webmail, by definition, is accessible using a web browser like Internet Explorer, Firefox, Chrome, Safari or Mozilla.  If you use a like WIndows Live Mail, Windows Mail, Thunderbird, Eudora mail client or another, then you will need to say that in your post, since how webmail and e-mail client/server operation are completely different.

    Like you say, if you use outitgoes like webmail, any errors that you see on your mailbox should be past on the server.  Thus, this isn't a problem, you can send, since it does not go on your computer and is not an error in your browser.  This is a problem on the server itself.  You will need to contact the technical support of outitgoes.

    References to an outitgoes SMTP server appear when you search for "outitgoes smtp.  This means that they offer client/server access to the letters.  If that's what you use, you must always contact outitgoes support because your email client tells you that it receives information from the mail server that it does not understand.  Outitgoes support should be able to help find the cause.

  • How you sort the list of the next iOS 10?

    I can't know how to sort the list by following in-app music on my iPhone 6 s.  In iOS 9, he had a handle on the right side next to the title of the song that you can tap and drag up/down to change the order of the playlist.  The handle does not appear in the App on iOS 10 music.

    So I guess you can't have activated repeat function.  Once it is off, the handles appear and you can sort your list of songs until the next.

  • Anyone know how to sort the files in windows 7.

    Anyone know how to sort the files in windows 7. All of a sudden my file says "a long..., there is this month...» Last week... today. I can't deal with all the files in the folder now. How can I keep rid of one a long time ago..., this month... Last week... today) so that I can fix the whole folder?

    Hello

    Right-click on an empty area of the concerned window, select Group By, and then select None.

    Best wishes

    DP - K

  • Don't know how to read the results of netstat EI s list? If I received 860592506 bytes sent from 43421482 how to convert MB? And does this mean byte received?

    Don't know how to read the results of netstat EI s list? If I received 860592506 bytes sent from 43421482 how to convert MB? And does this mean byte received?

    Hello

    This shows the total number of bytes transmitted and received via the Ethernet card. This is the total of the amount of use up to this day.

    This includes all the Web sites you have visited and emails you sent, etc..

    You can calculate using one of the following methods:

    Method 1:

    860592506 / 1048576 = 820,72 MB

    Method 2:

    Multiply 860592506 with 9.53674316 * 10 ^-7 that will give us the result in mega bytes.

    860592506 bytes = 820 MB 9MB not, accept my apology for the miscalculation.
    Similarly 43421482 acroos = 40MB

  • How to sort the videos Sony's AVCHD cam by DATE.

    How to sort the videos Sony's AVCHD cam by DATE.  500 clips in media browser PP are not ordained.  A little more of the FCP where appears the ingestation list, you check what you want and import.  It looks different in PP.  I dragged all the AVCHD folder on the camera (via the copy on the desktop Mac) media victory on PP.  He broke them in 500. Video clips of MTS which cannot be classified by date.  What should do?

    Hi Pup8888,

    pup8888 wrote:

    Here is what I could not say.  He pulls of a Sony 520 in ACVHD and somehow that the data CLEARLY arranged the clips in FCP do not appear in PP.  Maybe it's the issue.

    If you do not ingest the files through their structure to map intact complete with media browser and makes your entire organization in another application, Yes, I can see why some of the metadata is missing.

    pup8888 wrote:

    I also get a DEVICE NOT DETECTED in PP when the camera is clearly working in the new IMAC.

    The remote control is not available for file based devices, so I don't think you need to worry about this.

    pup8888 wrote:

    So I do drag the AVCHD HD folder and import all in PP and yes it in busts. MTS files and works very well but unsortable by date.  They are randomly dumped inn the media browser.  Thoughts?

    Can arrange you by date when they are ingested and in the project Panel? Arrange by date in the media browser would be a feature request. What to do here: http://www.adobe.com/go/wish

    Thank you
    Kevin

  • How to display the result of a java class in InputText?

    Hi all
    How can I get the result of the java classes to InputText or OutputText?
    also everyone in the forum can road map me to deal with Java in oracle adf because I am a beginner in oracle adf
    I saw a few samples in corner of oracle adf, but it is difficult for me.

    I use JDeveloper Version 11.1.2.3, technology of the Adf.
    My question is how to return the result of java Bean InputText or OutText
    Thank you

    see if you want to have show some .so beans instance variable value you can have a few bean .define managed a variable as
    string abc = "abc";

    create the getter set for her.

    in the value property of inputText or OutPutText write an el as #{beanscope.managedbeanName.abc}

  • How to display the result sqlplus in java?

    I want to call sqlplus to run some commands sql in java, but how can I print the result of sqlplus?

    In java code, I call sqlplus as:

    Process of p;
    Run the command
    p = Runtime.getRuntime () .exec (commandString);
    print the result of the command
    InputStream inputStream = p.getInputStream ();

    How to display the result of the execution?

    Published by: Yi on February 26, 2012 23:41

    You can use ProcessBuilder. Copy the following code starts sql * more and runs the script in the variable "filename". It displays the results in the console of NetBeans.

    import java.io.BufferedReader;
    import java.io.InputStreamReader;
    import java.io.File;
    import java.util.Map;
    
    public class test1 {
    
        public static void main (String args []) {
    
            test_script();
        }
    
        public static void test_script () {
    
            String fileName = "@test_table.sql";
            String sqlPath = "E:\\";
    
            String sqlCmd = "sqlplus";
    
            String arg1   = "user/password@sid"; -- plug in your user, password and db name
            String arg2   = fileName;
            try {
                String line;
                ProcessBuilder pb = new ProcessBuilder(sqlCmd, arg1, arg2);
                Map env = pb.environment();
                env.put("VAR1", arg1);
                env.put("VAR2", arg2);
                pb.directory(new File(sqlPath));
                pb.redirectErrorStream(true);
                Process p = pb.start();
              BufferedReader bri = new BufferedReader
                (new InputStreamReader(p.getInputStream()));
              BufferedReader bre = new BufferedReader
                (new InputStreamReader(p.getErrorStream()));
              while ((line = bri.readLine()) != null) {
                System.out.println(line);
              }
              bri.close();
              while ((line = bre.readLine()) != null) {
                System.out.println(line);
              }
              bre.close();
              System.out.println("Done.");
            }
            catch (Exception err) {
              err.printStackTrace();
            }
    
        }
    
    }
    

    Here is the content of the script at E:\\test_table.sql

    Prompt drop TABLE ANOTHER_TEST;
    DROP TABLE ANOTHER_TEST CASCADE CONSTRAINTS
    /
    
    Prompt Table ANOTHER_TEST;
    CREATE TABLE ANOTHER_TEST
    (
      BATCH_SEQ             NUMBER,
      BATCH_GROUP_ID        NUMBER,
      STATUS_FLAG           VARCHAR2(30 BYTE),
      OBJ_BEING_PROCESSED   VARCHAR2(80 BYTE),
      BATCH_RUN_START_DTTM  DATE,
      BATCH_RUN_END_DTTM    DATE,
      CREATE_DTTM           DATE,
      CREATE_USER           VARCHAR2(30 BYTE),
      UPDATE_DTTM           DATE,
      UPDATE_USER           VARCHAR2(30 BYTE)
    )
    LOGGING
    NOCOMPRESS
    NOCACHE
    PARALLEL ( DEGREE DEFAULT INSTANCES DEFAULT )
    MONITORING
    /
    
    COMMENT ON TABLE ANOTHER_TEST IS 'This is a test table.'
    /
    
    EXIT
    /
    
  • How to interpret the result of validation.

    How to interpret the result of validation.

    13366 [element < 7 >] [3, 4 rings] [edge < 0 > < 3 > cycle] [edge < 0 > in the < 4 > round]

    -ORA-13366: incorrect combination of inner outer rings
    -Cause: In Oracle Spatial geometry, the inner and outer rings do not always serve.
    -Action: Make sure that the interior rings corresponding to an outside ring follow the outer ring of the orderly table.

    I think it means that the rings 3 and 4 in element 7 have inside outside questions vs, but element 7 has no rings 3 or 4; There no cycles 1 and 2.

    I'm using Oracle Database 11 g Enterprise Edition Release 11.2.0.2.0 - 64 bit Production

    You can call sdo_geom.sdo_union on this geometry to fix.

    It's

    Update de_lec set c.lec_gcode = sdo_geom.sdo_union c (c.lec_gcode, c.lec_gcode,: tolerance)
    where c.lec_gcode = '9417';

    There is no fix for the problem of validation still on 11.2.0.2, so you have a file a bug for it if you need this patch.

    Siva

  • How to display the results in the order based on the value of research

    Hi all

    How to display the results in the slot order.
     
    
    CREATE TABLE TEST( SONGID  NUMBER, TITLE   VARCHAR2(200))
    
    INSERT INTO TEST(SONGID,TITLE) VALUES (10,'AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (11,'CICCONE, MADONNA (CA)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (12,'DALLIN, MADONNA LOUISE/STOCK');
    INSERT INTO TEST(SONGID,TITLE) VALUES (13,'MADONNA');
    INSERT INTO TEST(SONGID,TITLE) VALUES (14,'MADONNA (A)/ AHMADZAI, MIRWAIS (C)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (15,'MADONNA (CA)');
    INSERT INTO TEST(SONGID,TITLE) VALUES (16,'MIRWAIS AHMADZAI, MADONNA');     
    INSERT INTO TEST(SONGID,TITLE) VALUES (17,'MIRWAIS (CA)/ MADONNA (CA),AHMADZAI');
    INSERT INTO TEST(SONGID,TITLE) VALUES (18,'MADONNA (CA),CICCONE');
    
    SELECT *FROM  TEST WHERE INSTR (TITLE, 'MADONNA') > 0
    
    output: 
    SONGID     TITLE
    10     AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)
    11     CICCONE, MADONNA (CA)
    12     DALLIN, MADONNA LOUISE/STOCK
    13     MADONNA
    14     MADONNA (A)/ AHMADZAI, MIRWAIS (C)
    15     MADONNA (CA)
    16     MIRWAIS AHMADZAI, MADONNA
    17     MIRWAIS (CA)/ MADONNA (CA),AHMADZAI
    18     MADONNA (CA),CICCONE
    
    Expected output :
    13     MADONNA
    14     MADONNA (A)/ AHMADZAI, MIRWAIS (C)
    15     MADONNA (CA)
    18     MADONNA (CA),CICCONE
    ..
    ..
    ..
    ..
    ...
    If the user makes a search with "MADONNA", I view the results as title begins with "MADONNA" first then the rest of the records.
    Please let me know is possible to show the results in this order.


    Kind regards
    Rajasekhar

    This can be a little more specific:

    SQL> SELECT *
      2  FROM   TEST
      3  WHERE  INSTR (TITLE, 'MADONNA') > 0
      4  ORDER  BY INSTR (TITLE, 'MADONNA')
      5           ,TITLE
      6  ;
    
                  SONGID TITLE
    -------------------- --------------------------------------
                      13 MADONNA
                      14 MADONNA (A)/ AHMADZAI, MIRWAIS (C)
                      15 MADONNA (CA)
                      18 MADONNA (CA),CICCONE
                      12 DALLIN, MADONNA LOUISE/STOCK
                      11 CICCONE, MADONNA (CA)
                      17 MIRWAIS (CA)/ MADONNA (CA),AHMADZAI
                      16 MIRWAIS AHMADZAI, MADONNA
                      10 AHMADZAI, MIRWAIS (CA)/ MADONNA (CA)
    
  • How to sort the names in order albhabetical in Windows Mail on some recipients?

    Original title: Windows Mail

    Re my Windows Mail, the "Select recipients" list sorts e-mail addresses in alphabetical order rather than alphabetical order the real names, how can I change this?

    Hi sarahsdrive,

    Try these steps and check the result.
    a. in the Contacts folder: change the display «Détails»
    b. right-click on the 'Name' column header, click on "First name", then click on 'Last Name'
    c. click on "Last Name" to sort by this order, or click on the title "First Name" to sort by this order.
    d. in a window to create a message: click on:
    e. click the column 'Name' position... it cycles through 4 different kinds
    f. in Contact properties, click on the arrow pointing downwards at the end of the full name box

    Change Windows Mail send settings

    Visit our Microsoft answers feedback Forum and let us know what you think.

  • Sort the results of interactive report in no data found message

    Hello

    I have an interactive report that returns results based on the: bind variable QUERY - I have a list of navigation on the side where all the elements to link to the current page with different values of request. The IR works fine until I try to sort the columns by clicking on the heading and selecting increasing / decreasing, how it returns no data available.

    It starts to work again if I change the last line of GOLD: REQUEST IS NOT NULL but this breaks the functionality of the report, I would like to return only selected articles or all if no query variable is present. I'm guessing that sort sets: ASK something temporarily and divides. My query is below, any ideas?
    SELECT   id,
             job_number,
             appt_start,
             domain,
             pwa,
             status,
             tstamp_created 
      FROM   fail_jobs 
      WHERE  (status = 'NEW' AND userid_created != 'SYSTEM' AND :REQUEST = 'ARD') 
         OR  (status = 'ATR' AND :REQUEST = 'ATR')
         OR  (status IN ('ERR','REV') AND :REQUEST = 'REV')
         OR  (status = 'COM' AND :REQUEST = 'COM')
         OR  (status IN ('PCD','PCA') AND :REQUEST = 'PCD')
         OR  :REQUEST IS NULL
    Thank you

    There are problems with interactive reports referencing known: DEMAND value, probably due to an internal logic that manages also simultaneously - potentially cause a malfunction or blockages.

    A workaround that I learned is to create a calculation to assign: APPLICATION to a temporary element (a PXX_REQUEST, for example) and reference it in the query, instead of: ASK. This has worked well for me in my experience.

    I would like to know if this helps - pls sign the thread as 'Useful' or 'Correct' if so, so more people can benefit.

    TKS,
    Kléber

  • How to sort the images in the shared album

    Hello, I just realized that all my photos (including shared albums) felt "sort" the value 'keep sorted oldest first' checked and grayed out.  I can't seem to find a way to sort my photos by 'added more recent' or 'most recent on top.  Any ideas why the sorting option is a) gray and b) how to change that.

    Thank you for your help in advance.

    Helga

    You can sort not somehow: they appear in the order they are added to the shared album

    You can request additional options of Apple - http://www.apple.com/feedback/photos.html

    LN

  • RunState.ProcessModelClient. how to access the results of markets located in the loops?

    Hello

    In my sequence, I have to perform an analysis of the results before I have the MainSequence and return to the process template. Basically, I need to check made some steps has passed.

    I access the results using RunState.ProcessModelClient. Using what I have access to the list of results. I would like to write that I have access to each result but I can't because I spotted the results of steps which are curly are not accessible (they are not there); However, they are on the report.

    How is it possible? How do I access results in a loop? Where are they?

    K.

    Hello

    not too painful:

    the loop results in the usual place online, it's just the layout that will look like a little confusing:

    You use some revisions of my TestStand (you are in 3.1)

    The Runstate.ProcessModelClient is actually a copy of the space of time edit, not space running - it's the SequenceFile type, which means that even if you can see the layout of the result containers that belong to each step, they are there permanently, and not filled in this place from the moment of execution.

    At the level of the mainsequence, you're still in your client, then you can go to Locals.ResultList directly.

    In there, you have the singular element that is the result of the first and the only stage of your Mainsequence of your.

    Inside there is the. TS. SequenceCall container. It is effectivey the resultlist gait that calls (always Mainsequence) seq1 so inside that, there is an another ResultList.

    It's the ResultList for sequence "Seq1".

    Which has a single item since this sequence has only one step inside of type SequenceCall.

    [0]. TS. SequenceCall.ResultList.

    From there you can see a lot of results even if you have only 4 effective steps in this sequence.

    12 results covers:

    3 iterations of ('for' 'Test2' 'end').

    and then the last 3 items are "Test1" loop 2 times more.

    When you set a stage of the loop and include you the results of each iteration, you get these results (2 in your case) more a global success-failure based on the criteria (your care ot 100% must pass in order to study the step successful when all iterations are complete.)

    Note in your pre Expression where you change the name of the step on the fly, your labeled Test2 incremental changes the name from 'Test1' + Str (Locals.LI), and the Test1 marked step uses the same expression for this will look slightly confused that you cross your results.

    Hope that helps.

    Thank you

    Sacha

Maybe you are looking for

  • I would like to be able to display the clock on my computer

    When I run Mozilla it takes my screen and I would still be able to see the clock in the bottom right of my computer screen. How to allow me to see my clock?

  • Drag n Drop works but is not accessible

    I lost Drag n drop and reinstalled from my disc utilities. I run 2000 on this computer for backup. I loved this software if I have other software on my XP desktop. Prefer the Drag n Drop. Uninstalled and reinstalled 5 times. Can not find the software

  • keep running itunes when you connect

    I have iTunes running on a windows server 2012R2. the server is in a rack, so I need to RDP in there nothing to do. No mater how I logoff, iTunes always is closed. I have installation "iTuneServiceSetup.msi" keep iTunes running as a service and it wo

  • The quit event structure works when I switch the cdaq to crio

    I changed my structure of producer of written consumer 2009 for use crio in 2010 and my event structure enough work. The event source is the same.

  • IMA Newbie

    I have an Acer Extensa 5230th and my daughter has been using it.  The downside is that he has slowed down a lot, and I never had done backup discs.  I want to format the hard drive and start over.  What should I do to get all the drivers and software