Need help to find a way to order by chronological period

Hello

I have a query as below:

SELECT GL_PERIOD_NAME, EXPENDITURE_ITEM_ID
OF apps.PA_COST_DISTRIBUTION_LINES_ALL d
WHERE LINE_TYPE = 'R '.
AND LINE_NUM = (SELECT MAX (LINE_NUM)
OF apps.PA_COST_DISTRIBUTION_LINES_ALL
WHERE EXPENDITURE_ITEM_ID = d.EXPENDITURE_ITEM_ID
AND LINE_TYPE = 'R')
It gives me the output voltage:
APR-08
APR-09
AUG-08
AUG-09
DEC-08
DEC-09
.........
.........

Could someone please tell how to do it in chronological order that as below:
JAN-08
JAN-08
MAR-08
.........
.........
JAN-09
FEB-09
.......
.......

Help, please.

Thank you

Add the following at the end of the statement:

order by to_date(gl_period_name, 'MON-YY')

Published by: bluefrog on March 31, 2010 13:33

Tags: Database

Similar Questions

  • I need help to find a way to correct or update the drivers for two DVDs that I have on my PC. Device Manager indicates that they are missing or have been corrupted, and they are a product of microsoft.

    I tried to play a number of different disc, both DVD players and nothing seem to work.

    Your CD/DVD drive is missing or is not recognized by Windows or other programs:

    http://support.Microsoft.com/kb/982116

    Your CD or DVD drive cannot read or write media - Fix It:
    http://support.Microsoft.com/mats/cd_dvd_drive_problems

  • Need help to find bosses and leaders out there

    Hi all

    I need help to find patterns, but also the number of occurrences of these models in the data in the column of the table.

    Consider the examples of data - column of a row in a table:

    'S-S-S-P-S-B-S-S-C-S-P '.

    My requirement is:

    I should get all the models that are followed is "."

    For example, the foregoing, given given bosses and Auditors are
    SS - count is 3
    SP - count is 2
    SB - 1 is
    SS - count is 1

    There is a condition most the above requirement:

    If' is followed by 'A', then 'SA' is not as a model. The model must stretch until a character no 'A' is found.

    Consider the sample data for the above case:

    'S-S-A-S-S-A-A-C-S-P-S-A '.

    previously given given bosses and Auditors are
    SS - count is 2
    SP - count is 1
    SAS - count is 1
    SAAC - count is 1

    The column data is stored as type VARCHAR2.

    I have Oracle Database 11 g Enterprise Edition Release 11.1.0.6.0 - 64 bit Production

    Thanks in advance,
    Girish G

    Hi, Girish,

    Girish G wrote:
    Hi all

    I need help to find patterns, but also the number of occurrences of these models in the data in the column of the table.

    Consider the examples of data - column of a row in a table:

    'S-S-S-P-S-B-S-S-C-S-P '.

    My requirement is:

    I should get all the models that are followed is "."

    Do you mean "I should get all the models who * begin by * of '?

    For example, the foregoing, given given bosses and Auditors are
    SS - count is 3
    SP - count is 2
    SB - 1 is
    SS - count is 1

    Why are there two production lines for "SS"? The other, with count = 1, mean doing just that?

    There is a condition most the above requirement:

    If' is followed by 'A', then 'SA' is not as a model. The model must stretch until a character no 'A' is found.

    Consider the sample data for the above case:

    'S-S-A-S-S-A-A-C-S-P-S-A '.

    previously given given bosses and Auditors are
    SS - count is 2
    SP - count is 1
    SAS - count is 1
    SAAC - count is 1

    The column data is stored as type VARCHAR2.

    I have Oracle Database 11 g Enterprise Edition Release 11.1.0.6.0 - 64 bit Production

    Thank you; version information are very useful.

    Thanks in advance,
    Girish G

    Whenever you have a question, please post a small example of data (CREATE TABLE and INSERT statements) and the results desired from these data.
    For example, the sample data may be:

    CREATE TABLE     table_x
    (       x_id     NUMBER     PRIMARY KEY
    ,     txt     VARCHAR2 (30)
    );
    
    INSERT INTO table_x (x_id, txt) VALUES (1, 'S-S-S-P-S-B-S-S-C-S-P');
    INSERT INTO table_x (x_id, txt) VALUES (2, 'S-S-A-S-S-A-A-C-S-P-S-A');
    

    and the results desired from these data can be:

    X_ID TXT                       PATTERN                          CNT
    ---- ------------------------- ------------------------- ----------
       1 S-S-S-P-S-B-S-S-C-S-P     SB                                 1
       1 S-S-S-P-S-B-S-S-C-S-P     SC                                 1
       1 S-S-S-P-S-B-S-S-C-S-P     SP                                 2
       1 S-S-S-P-S-B-S-S-C-S-P     SS                                 3
    
       2 S-S-A-S-S-A-A-C-S-P-S-A   SAAC                               1
       2 S-S-A-S-S-A-A-C-S-P-S-A   SAS                                1
       2 S-S-A-S-S-A-A-C-S-P-S-A   SP                                 1
       2 S-S-A-S-S-A-A-C-S-P-S-A   SS                                 2
    

    (Which is what you have posted, except that there is only one line of output for "SS" when x_id = 1.)

    One way to achieve these results in Oracle 11 is:

    WITH   got_s_cnt    AS
    (
         SELECT     x_id, txt
         ,     REGEXP_COUNT (txt, 'S')     AS s_cnt
         FROM     table_x
    )
    ,     cntr          AS
    (
         SELECT     LEVEL     AS n
         FROM     dual
         CONNECT BY     LEVEL <= (
                                   SELECT  MAX (s_cnt)
                             FROM    got_s_cnt
                               )
    )
    ,     got_pattern     AS
    (
         SELECT     s.x_id
         ,     s.txt
         ,     c.n
         ,     REGEXP_SUBSTR ( REPLACE ( SUBSTR ( txt
                                                 , INSTR (s.txt, 'S', 1, c.n)
                                    )
                             , '-'
                             )
                         , 'SA*[^A]'
                            )       AS pattern
         FROM    got_s_cnt  s
         JOIN     cntr        c  ON  c.n  <= s.s_cnt
    )
    SELECT       x_id
    ,       txt
    ,       pattern
    ,       COUNT (*)     AS cnt
    FROM       got_pattern
    WHERE       pattern     IS NOT NULL
    GROUP BY  x_id
    ,            txt
    ,       pattern
    ORDER BY  x_id
    ,            pattern
    ;
    

    At the heart of this query is the call to REGEXP_SUBSTR:

    REGEXP_SUBSTR ( x
               , 'SA*[^A]'
               )
    

    who is looking:
    S = the letter S
    A * = the letter A, 0 or more times
    [^ A] = nothing, except the letter A

  • Need help to find and install the game Chess Titans Windows Vista for XP

    Need help to find and install the game Chess Titans Windows Vista for XP

    Hi SBOYDC130guy,

    We will not be able to install titan of failures on windows XP because it is designed for Windows Vista and Windows 7 and it's built-in game.

    With regard to:

    Samhrutha G S - Microsoft technical support.

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

  • need help to find the windows vista key

    need help to find windows vista key product I lost my kit, but I have windows vista cd/dvd. Please answer me as soon as posssible, thank you

    http://magicaljellybean.com/KeyFinder/

    Use the program above to find the product key in your operating system Vista running and active.

    If a desktop computer: Watch next or back.
    If a laptop: look on the underside.

    If a recovery disk, most of the manufacturer's recovery disks do not need a product key to get back to factory settings.

    This is the limit of the help that we can give you a missing product key.

    See you soon. Mick Murphy - Microsoft partner

  • I JUST DOWNLOAD THE CC ON MY DESKTOP N HAVE NO IDEA WHERE TO START PHOTO EDITING IT S LITTLE DIFFERENT OF MY ITEM 12 NEED HELP TO FIND THE TUTORIAL THANK YOU A.S.A.P.

    I JUST DOWNLOAD THE CC ON MY DESKTOP N HAVE NO IDEA WHERE TO START PHOTO EDITING IT S LITTLE DIFFERENT OF MY ITEM 12 NEED HELP TO FIND THE TUTORIAL THANK YOU A.S.A.P.

    Start with the tutorials in the Welcome window to start and takes a course from a site like Lynda.com.

  • Need help to find the "main point size.

    Hello

    I need help to find the "main point size.

    Any style of Pará which is more than 2 points of my font size, I need the alert message "His more than 2 points for your font size". For example, the font size of my para 10 here is my attack should be 12 points rather than his 14 points, I need the alert message.

    Is it possible by script?

    by

    hasvi

    Hi Hasvi,

    Try this.

    var doc = app.activeDocument;

    var texts = doc.stories.everyItem ().textStyleRanges.everyItem () .getElements ();

    pstyle var = ' Suite of paragraph styles have more leadings: \r\r ";

    for (var i = 0; i)<>

    {

    PS var = text [i] .pointSize;

    If (texts [i] .leading > ps + 2).

    {

    pStyle += text [i].appliedParagraphStyle.name;

    }

    }

    Alert (pStyle)

    While it is true that mark as answer correct and do not select your question as a correct answer.

    Kind regards

    Cognet

  • Is there a way to order Instant chronological order in Lightroom 6?

    Is there a way, a way to order Instant chronological order in Lightroom 6?

    Are you referring to SNAPSHOTS in the develop Module? (no Photos)

    When you create a snapshot, the automatically proposed file name is in the format {time}.

    Instead, you can type a descriptive name for the snapshot.

    Now consider the list of snapshot will sort Alpha/Digital-So numbers before the letters (digital sort) and then alphabetically. -as in this screenclip -.

  • HP-15f039wm: need help to find the driver

    I got lost. need help finding the (USB) Universal Serial Bus controller. would be very grateful for help.

    Hello

    Try the driver on this link.

    http://ftp.HP.com/pub/SoftPaq/sp66001-66500/sp66211.exe

    Kind regards

    DP - K

  • Want to hp 15-d099nr: I need help to find discs for an hp 15-d099nr operating

    Hi I tried to find something on the HP site and I can't find any page to order the operting discs. My sister bought this laptop and operaing system was wiped out.

    Hello

    in the link below click on the last option order recovery disks

    http://support.HP.com/us-en/drivers/selfservice/HP-15-notebook-PC-series/6627588/model/7096708

    from your PC with win 8.1, you can get 8.1 disks.

    or try this link

    https://support.HP.com/us-en/mediaorder/HP-15-notebook-PC-series/6627588/model/7096708/softwareitem/754713-002/STEP1

  • I need help to find the correct version of the BIOS.

    As the title says I need assistance to find the correct version of the BIOS and now I have P02 - A2: 2011-10-31 and an Acer G3610 predator.

    I need an update is because I bought a new CPU and when I start the computer, it starts only for like 2 sec then turns off then on again one then it emits a beep of 3 or 4 times, then he is leaving and on but never goes Windows just a black screen so my guess is that I have an older version of the bios that does not recognize the CPU.

    Nope.

    I think they changed the revision of the motherboard, so you can't Flash this BIOS on your system.

    That's why you have a size mismatch error.

    So, you can not upgrade to Ivy bridge, sorry.

  • Need help to find and replace

    Hi all

    I need assistance to find and replace words between \ make "BOLD" and delete the symbol in my pages just like below.

    Text example:

    He astonished his parents by \turning a childhood obsession\ in a decent-paying career, much to their dismay.

    After the text:
    He astonished his parents by turning a childhood obsession into a decent-paying career, much to their dismay.

    Thanks in advance,

    Siva

    (\\+?) will never return more than 1 backslash because the? is telling to find the shortest match. {I would change that to each (\) or (\\{2)}

  • Urgent need help with find and change / GREP

    I'm working on a manual that contains more than a thousand paintings. I'm not quite familiar with GREP and need help to determine the right to coding/jokers to change the character style to a group of words/numbers on a global basis.

    For example, in Chapter 7, a paragraph style is applied to this line of text:

    TABLE 7.1: T4, T3, FREE T4 AND FREE T4ED

    I need to change "table 7.1:" for a character style and so of suite/so on up to "Table 7,150:"-while leaving the other numbers on the same line unchanged also.»» Is it possible to do without having to manually each table style number?

    gd247 wrote:

    I'm working on a manual that contains more than a thousand paintings. I'm not quite familiar with GREP and need help to determine the right to coding/jokers to change the character style to a group of words/numbers on a global basis.

    For example, in Chapter 7, a paragraph style is applied to this line of text:

    TABLE 7.1: T4, T3, FREE T4 AND FREE T4ED

    I need to change "table 7.1:" for a character style and so of suite/so on up to "Table 7,150:"-while leaving the other numbers on the same line unchanged also.»» Is it possible to do without having to manually each table style number?

    No need for GREP. If "TABLE 7.1:" is text, you can create a nested character style that extends through the colon, in the paragraph style. "

    If "TABLE 7.1:" is created by a numbered list of automatic type paragraph style, you can specify a character style named for the part of automatic numbering in the drop-down menu Style of character, in the Style of numbering of the chips section and numbering of the dialog box Options of paragraph style. If the character style does not exist, you can stay in the operation of paragraph options by choosing 'New Style of character' in the menu. After you create the new style, you're back in the process of definition of the paragraph.

    HTH

    Kind regards

    Peter

    _______________________

    Peter gold

    Know-how ProServices

  • Need help to find an adapter for a third-party monitor

    Hi all! I find myself in need of a little guidance, and I hope that someone out there will have a quick n easy for me...

    I have a Mid-2011 27 'iMac. which has two ports Thunderbolt It is taken with a Wacom tablet that I use constantly, and the other is made by an external hard drive to a solid state, which has a built-in cable to Thunderbolt (no way to hang it on a different port). I also have a 27 "HP monitor that is currently connected via an HDMI USB adapter.

    The problem is that the HP monitor is actual "jiggy" - the USB does not seem fast enough to deal with requests for the monitor. It is almost unusable. I know I should run it via a HDMI adapter Thunderbolt, but as I have already mentioned the two my Thunderbolt ports are already in use.

    Someone at - it ideas? I need sort of three to two ports Thunderbolt hooks, but I can't seem to find anything for less than $300 that would work. (I am illiterate when it comes to the different cables, adapters, ports, etc., so I hope someone can point me in the right direction by using short words... Most of the products that I travel through list specifications that me Chicane).

    The monitor has two HDMIs and a VGA port, and my iMac has a Firewire 800 port, if that helps at all...

    2011 iMac have only 1 Thunderbolt port and there is no such thing as a Mid-2011, you must have an iMac of year later, if it has 2 ports Thunderbolt. All the 27 "iMacs, from 2012 to 2015 the current have 2 ports Thunderbolt.

  • HP pavilion dm1: need help to find the correct drivers

    Hello

    my laptop was incredibly slow, so I formatted my drive and reinstalled windows 7. Now to looking for reinstall the proper drivers, but can't find the right one.

    My laptop is a HP Pavilion dm1, model 3387 36.0 A (according to CPU - Z)

    K12 F.01 BMI and Bios HP AMD chipset

    If you need more information please let me know.

    Thanks in advance for any help you can give,

    with sincere friendships.

    Low van den Dungen

    Hello @Bas4,

    Thanks for the quick response!

    Please use the following link to find the product number of your laptop:

    How can I find my model number or product number?

    Using the product number, follow the instructions in my previous post, and you should be able to access the drivers for your product.

    I hope this helps.

    Please let me know if this information helps you solve the problem by marking this message as 'accept as Solution' , this will help others easily find the information they seek.  In addition, by clicking on the Thumbs up below is a great way to say thank you!

    Kind regards!

Maybe you are looking for

  • Replacing the power supply on a HP Pavilion P6000

    Outputs video (DVI and VGA) were both released on my motherboard. Rather than go through the hassle of dealing with Microsoft if I had to replace the MB, I decided to install a MSI Geforce 210 graphics card and the existing PCI express slot. However,

  • Access the values of cells in neighboring XTable Diadem

    Hello Can someone please help me understand how to access values in adjacent cells in the case of XTable EventValSet? Void XTable1_EventValSet (ByRef ByRef this, lines, columns, cells) ' set the event handler Select the box collar Case 1 neighbor2 =

  • HP Pavilion 17 Laptop: laptop, usb external speaker iHome and HP Pavilion 27 x 1

    I have a HP Pavilion 17 laptop (Windows 8.1, x 64, AMD A8) and a HP Pavilion 27xi monitor connected to the laptop via HDMI.  Because the monitor has no Audio, I connected an external speaker from iHome usb/bluetooth to the laptop using the connection

  • HP charger compatibility

    Hello! I recently bought a new laptop (the one got stolen), and I was wondering if I could still use my old charger. Old charger hp pavilion dv7-6c50eb, new laptop is hp dv6-7280eb envy. Thanks in advance! Charles

  • screen resolution bug

    I have a small problem, sometimes after playing games on my computer, the screen resolution must be changed so that the game will play correctly. But after shutting down my computer and turning back on (usually with a space for a day or so between th