values based on the following logic 'values after the first values of two '_' and before last '_' values '.

Hi all

I need the values according to below 2logics in a single select query using instring and substring

1 values based on the following logic 'values after the first values of two '_' and before last '_' values '.

2 values based on the following logic 'values after the first values of two '_' and before last'-'values '.

EXM:

Entry: ABCD_EFGH_IJKLM - NOPQ_XYZ output: IJKLM - NOPQ

Entry:. ABCD_EFGH_IJKLM - NOPQ output:IJKLM

Thank you.

Check the following

WITH DATA1 AS

(SELECT "ABCD_EFGH_IJKLM - NOPQ_XYZ" double val)

UNION ALL

SELECT 'ABCD_EFGH_IJKLM - NOPQ' double val

)

SELECT SUBSTR (VAL, INSTR(VAL,'_',1,2) + 1, DECODE (BIGGER (INSTR (VAL, '_',-1, 1), INSTR(VAL,'-',-1,1)), INSTR (VAL,'-', - 1, 1), LENGTH (VAL) + 1, INSTR (VAL, '_',-1, 1))-(INSTR (VAL, '_', 1, 2) + 1))

OF DATA1;

Concerning

Salim

Tags: Database

Similar Questions

  • Why are on the first web page are buttons and following pages Don t-shaped? All Pages are based on the same Masterpage.

    Hello

    I ve a problem with Muse.

    Why are on the first web page are buttons and following pages Don t-shaped? All Pages are based on the same Masterpage.

    Any ideas?

    Stefan

    Hello Stefan,

    Could you please share your with us .muse file to study? Please send it to [email protected]. If your file is larger than 20 MB, you can use something like Adobe SendNow SendThisFile or Dropbox. Don't forget to mention the link to this forum thread in your email so that we can identify the file.

  • Limit the number of characters in a text based on the first digit field

    Hello and thank you in advance for your help!

    I want to limit the amount of characters in the text field based on the first digit of the number (the text field is limited to a number format... no decimals, no comma).

    For example, if the number starts with a 3, I would limit the text field to allow only ten characters. I have three scenarios but if I could start with code and what is the best place to add (key combination or validation?) I can take it from there. Thanks again for your help!

    I wrote this code for you that does this. Use it as a typo of the custom field code:

    // Validate that only digits are entered
    if (event.change) {
        event.rc = /^\d+$/.test(event.change);
    }
    
    // Validate string length if it starts with 3
    if (/^3/.test(AFMergeChange(event))) {
        event.rc = AFMergeChange(event).length <= 10;
        if (!event.rc) app.alert("If the number starts with \"3\" it may not be longer than 10 digits.",1); // optional error message
    }
    

    You can duplicate the second part of it for additional terms, but keep in mind that this code won't let you even remove the first character in the field if the result is not valid.

    For example, if you enter "234567890123456" then you can't remove the "2" at the beginning because that would result in a number not valid. You can delete all the other numbers, even if and when it is 10 digits or less, then you can remove the departure "2" as well.

  • cannot open the first Adobe pro to buy and download directly from CC

    Hello, I would like to know, because I can't open the first Adobe pro to buy and download directly from CC, I've updated it appears instead of open.

    You MUST have a 64-bit computer what is your computer?

    MINIMUM for After Effects and Premiere Pro http://helpx.adobe.com/premiere-pro/system-requirements.html

    -Programs does not appear if they are not installed on your computer

    -http://helpx.adobe.com/creative-cloud/kb/all-apps-displayed-aam.html

  • My one year contract is about to expire. Can I extend the same price for two months and cancel the contract without redoing the accession of another full year?

    My one year contract is about to expire. Can I extend the same price for two months and cancel the contract without redoing the accession of another full year?

    Hello

    The plan of photography is an annual plan therefore would renew for another 12 months.

    Under the terms of subscription, an early termination fee would be applied if you have decided to cancel two months in the new contract - Adobe - General conditions of subscription

    Fill the cloud creative and plans unique app are available on a monthly basis, which can be another option - https://creative.adobe.com/plans

    Kind regards

    Bev

  • Hello, I would like to know, because I can't open the first Adobe pro to buy and download directly from CC, I've updated it appears instead of open.

    Hello, I would like to know, because I can't open the first Adobe pro to buy and download directly from CC, I've updated it appears instead of open.

    Please try: https://helpx.adobe.com/manage-account-membership/cc-reverts-to-trial.html and let us know if this helps.

  • Hi, I downloaded the first disc of Elemtns 10 and everything seems to be complete... What are th

    Hi, I downloaded the first disc of 10 items and everything seems to be complete... What are the other 4 drives for?

    Watch this link in the section description DVD: -.

    http://helpx.Adobe.com/Photoshop-elements/KB/install-premiere-elements-Photoshop-elements. HTML

  • Change the color of cell based on the first character of the value of the field

    Inside of a RTF model, I have a field called I_DESCRIPTION.

    If the first character of the value of I_DESCRIPTION is 'E' then I want the table cell to be red. Otherwise, I want it to be blue.

    I thought I'd be able to use the following type of code:
    <?xdoxslt:ifelse(substring(I_DESCRIPTION,1,1)='E', 'IT IS E', 'Not E')?>
    The above works. The only problem is, I don't know how to change the above, so that instead of print 'IT IS E' or 'NOT E' it changes the color of the cell in the table in red or blue.

    I guess I have to put something like the following in the second and the third argument to the ifelse() function:
    <?attribute@incontext:background-color;'#FF0000'?>
    But after much trying, I can't work on everything at is how this fits.

    Ideas or suggestions appreciated.

    Thank you
    Andy

    Hi Andy,.

    You can try this:

    1. in the cell where you view the description field, insert a form of conditional formatting field and use the following code: Red

    You will need to check the condition of other another field of form CF: Blue

    Hope this helps.
    Thank you!

  • Delete based on the first column or column second row

    Dear members,

    Need to remove a MasterTable lines based on the value in an another RefTable (which is a subset of the main table) colA or ColB.

    / * Value refTable wedges designed to be
    create table RefTable (int num1, num2 int, int temp)

    Insert in the values of numbers (44445, 44444 11111)
    Insert in the values of numbers (44446, 44444 11111)
    Insert in the values of numbers (44447, 44444 11111)

    Insert in the values of numbers (55555, 55551, 11111)
    Insert in the values of numbers (55555, 55552, 11111)
    Insert in the values of numbers (55555, 55553, 11111)

    Insert in the values of numbers (22222, 22222 11111)
    Insert in the values of numbers (22222, 22222 11111)

    Suppose that MasterTable has given below
    create table MasterTable (int num1, num2 int, int temp)
    Insert in the values of numbers (22222, 22222 11111)
    Insert in the values of numbers (22222, 22222 11111)
    Insert in the values of numbers (22222, 22222 11111)

    Insert in the values of numbers (44444, 44444 11111)
    Insert in the values of numbers (44445, 44444 11111)
    Insert in the values of numbers (44446, 44444 11111)
    Insert in the values of numbers (44447, 44444 11111)

    Insert in the values of numbers (55555, 55551, 11111)
    Insert in the values of numbers (55555, 55552, 11111)
    Insert in the values of numbers (55555, 55553, 11111)
    Insert in the values of numbers (55555, 55554, 11111)

    insert into numbers values (4567, 12345, 11111)
    insert into numbers values (5678, 23456, 11111)

    The query should execute delete on MasterTable RefTable value-based to get the result that

    4567 11111-12345-
    5678 23456-11111.

    I tried to change the query something like
    delete of the MasterTable where num1 = any (select num1 of RefTable); but it can only manage the deletion of the colA part... Any suggestions
    Is this ?
    
    DELETE
    FROM
         MasterTable mt
    WHERE
         EXISTS
         (
              SELECT
                   1
              FROM
                   RefTable rt
              WHERE
                   rt.num1 = mt.num1
                     OR
                            rt.num2 = mt.num2
         )
     
    
  • Sorting the rows in the table based on the first character - speed-problem

    Hello

    I have a text file with a lot of lines. The file is imported into LV, and must be sorted by the first character.

    It works very well, but gets very slow lines if too.

    If 40,000 lines then take 0. 2 s.

    If 400,000 lines then the time rises with factor 100 in 25 years.

    If 1,000,000 lines then the weather is dry 222 (~ 4 min)

    Attached is the code which sorts a table to text.

    The number of lines can be set with the meter of the loop (Loop-counter * 4 = NumberOfLines)

    The elapsed time is displayed.

    How to speed this up? (Or check the more linear time number of rows)

    Thank you

    You can try something like that. If you treat a table line by line, you end up taking a lot of time.

    Sorry I have a problem of fixing of the VI.

  • Based on the same Page of each tab and don't delete. Need help!

    [UPDATED BELOW WITH THE SOLUTION]

    The best way I can describe what I'm trying to achieve is the native music BB10 application navigation structure.

    Once you click on a track, you have to push the "Now Playing" view, and then that you go back to the navigation of your library, you can return to this view via a thumbnail image in the title bar. Of course, the view is not destroyed, that the page is running the music. But as you will see, this miniature in the title bar can be found in all the tabs and push the view "Now Playing" no matter what tab, you're in.

    I find it impossible to reproduce. I have a NavigationPane in each of my tabs, and maintain a single instance of the "Now Playing" view in the variant of nowPlayingView property. All seen below in my main.qml file:

    import bb.cascades 1.0
    
    TabbedPane {
        property variant nowPlayingView: nowPlayingComponent.createObject()
        Tab {
            id: tab1
            NavigationPane {
                id: navPane1
                FirstView {
                }
            }
        }
        Tab {
            id: tab2
            NavigationPane {
                id: navPane2
                SecondView {
                }
            }
        }
        Tab {
            tab3
            NavigationPane {
                id: navPane3
                ThirdView{
                }
            }
        }
        Tab {
            tab4
            NavigationPane {
                id: navPane4
                FourthView{
                }
            }
        }
        attachedObjects: [
            ComponentDefinition {
                id: nowPlayingComponent
                source: "NowPlaying.qml"
            }
        ]
    }
    

    Then, all pages, it is easy to access the nowPlayingView and push it through the respective navPane. The code below is from FirstView.qml which is in tab 1.

    navPane1.push(nowPlayingView);
    

    The problem is that I can successfully push this nowPlayingView one of the tabs, as long as it's the first time. So if I push everything first using navigationPane of Tab1, I am unable to shoot from all others, but it can grow as many times I want again on Tab1. The same applies if I pushed first view of the Tab2.

    How can I push this view of one of the tabs, while not to delete the page each time it is released. Please, please, any help would be appreciated. Just check out the music app native bb10 to understand the flow of navigation that I try to imitate. And as I understand it, it is not possible to use a single navigationpane for all tabs.

    Thank you!

    [CODE WORK] thanks to Zmey!

    QML, before pushing the view I must remove its previous parent by calling on C++.

    app.removePageParent(mediaView);
    navPane.push(mediaView);
    

    Using this helper function from C++ to remove the parent of the page

    void ApplicationUI::removePageParent(QObject *o) {
        //qDebug() << "removing page parent";
        o->setParent(NULL);
    }
    

    It will be for some reason doing two "back" button when you press the view again (bug sdk). To resolve this issue, manually set the back button.

    paneProperties: NavigationPaneProperties {
            backButton: ActionItem {
                onTriggered: {
                    mediaView.parent.pop()
                }
                title: "Back"
            }
        }
    

    I hope this helps someone! All creds to Zmey!

    Hello

    push() method description mentions that the parent of the page must be null or NavigationPane to which the page is pushed in.

    Try setting page.parent to null before pushing the page (this also can be done in NavigationPane onPopTransitionEnded).

    UPD: it did not work because the parent is readonly in QML. We had to make a C++ helper function and use setParent().

  • second drop-down list based on the first drop-down list Jdev 11.5 of loading

    Hi all

    I have a requirement of the second dropdown on the first loading selection drop-down list.

    Ex:-con I drop down state list, when I select and national, it must load city States (dropdown).

    I tried to use valuchange Stanley with partial trigger, that it did not work. Any help would be a great help.

    Please let me know.

    Thank you
    Nitin

    Published by: 811407 on December 21, 2011 02:59

    Published by: 811407 on December 21, 2011 02:59

    http://www.YouTube.com/watch?v=nXwL2_RP7AQ.

    you for example: here goes.
    http://www.YouTube.com/watch?v=94PrwXWDEjI

    http://andrejusb.blogspot.com/2008/12/cascading-lovs-in-Oracle-ADF-11g-update.html

  • What is the difference between these two JKM and when to use that one.

    Please tell the difference between these two.
    JKM Oracle compatible o JKM Oracle compatible (Date of update)

    Basic difference is in the obligation.

    JKM Oracle compatible (Date of update) wants a DATE/TIMESTAMP column in the source tables (s) who will get inserted/updated updated by the source application. ODI will capture the data modified, based on the value of this column. Only the DELETION part requires a trigger to keep track of deletion happening at source one or more tables.

    Where as JKM uniform Oracle does not require any which TIMESTAMP column in the tables of the source (s). It uses triggers to keep track of the INSERT/UPDATE/DELETE happening in the source.

    Compatible JKM Oracle performance (Update Date) is preferable, because it will create a little over the head on your source system. SO if you have a DATE/TIMESTAMP column in the tables of the source (s) that gets inserted/updated by the source application, then go JKM Oracle compatible (Date of update).

    Otherwise search JKM consistent Oracle.

    Thank you
    Fati

  • How can I configure FF to start typing before? Such as if I am on a Web Site that needs my personal info, I put in the first letter of my email and FF puts the rest?

    How can I configure Firefox to start typing before? Such as if I am on a Web Site that needs my personal info, I put in the first letter of my e-mail and Firefox puts in the rest of the letters? IE has implemented this. It makes just so typing more easy to personal information.

    Firefox has a 'rudimentary' fill or "AutoComplete" feature, which is linked to the history of form and research.

    https://support.Mozilla.org/en-us/KB/control-whether-Firefox-automatically-fills-forms

    https://support.Mozilla.org/en-us/KB/Firefox-doesn ' t-economy-web-form-entries

    Users should be cautious to they clear recent history what they deselect Form & Search History; This data is stored in its own cache and not saved in a data file.

    As Fred mentioned, using an 'auto fill' extension is preferred by many users. This type of extension allows user implement their data of a personal nature and then to have this 'auto fill' information as required on the Web page "Forms."

    Currently, the most popular "auto-fill" extension seems to have disappeared of Addons,Mozilla.Org site in the last day or two. I had seen a number of threads of support on a compatibility issue in Firefox 50 with this extension; and I suspect that the developer he shot the AMO site. Not sure if this developer will solve the compatibility problem (probably several processes) prepares a new extension to the new format of WebExtensions, or that it is right to give up with his "auto-fill" extension I saw it listed in the AMO Tuesday; Today, it's gone.

    Personally, I have little use for this type of extension, but I don't use and provide suggestions of development (aka criticize what they were doing, FRO the view of "long term user") for a "auto-fill" extension of return in 2004 in the run-up to the release of Firefox 1.0. These developers have created what I would call an add-on "cutting edge", but ran into problems of compatibility silly every week because of Mozilla. And by the time Firefox 1.5 came out 6 months later and 1.5 changes to this extension, developers just gave and 'we' lost this particular extension. After using the 'ultimate auto-fill' extension I've tried a few others, but they have failed in comparison; and since my need was not great I just stuck with the function 'auto' by default.

    It's a real shame that Mozilla has not seen fit to extend these basic features "AutoComplete" over the past 10 years; but hey, it's software development! Redo the UI repeatedly and ignore the basic features; who looks better on a RESUME "as"scut"work that few potential employers will enjoy.

  • Order for the first time lost all work and settings.  It can be recovered?

    Close my new Macbook Pro for the first time.  I lost all my work and my settings.  Almost anything can be recovered?

    He was an administrator account or a guest account?

Maybe you are looking for