How to cut the column data

Gurus in the morning

I have two tables with the data in the corresponding column, BUT I need to cut the columns in a table
the data is displayed as follows in table xpq_log
LOG_DATE                     LOG_PTR     LOG_HDR
01/06/2011 00:00:00     0609pro     0609IN002C_06
04/06/2011 00:00:00     0609pro     0609IN002C_06
05/06/2011 00:00:00     0609pro     0609IN002C_06
06/06/2011 00:00:00     0609pro     0609IN002C_06
07/06/2011 00:00:00     0609pro     0609IN002C_06
09/06/2011 00:00:00     0609pro     0609IN002C_06
10/06/2011 00:00:00     0609pro     0609IN002C_06
12/06/2011 00:00:00     0609pro     0609IN002C_06
01/06/2012 00:00:00     0609pro     0609IN002C_06
02/06/2012 00:00:00     0609pro     0609IN002C_06
03/06/2012 00:00:00     0609pro     0609IN002C_06
06/06/2012 00:00:00     0609pro     0609IN002C_06
07/06/2012 00:00:00     0609pro     0609IN002C_06
08/06/2012 00:00:00     0609pro     0609IN002C_06
09/06/2012 00:00:00     0609pro     0609IN002C_06
In the table of printpdf as follows
PDF_REPORT     PDF_DESCRIPTION
IN002C                     STOCK FILE PURGE - PRINT WH CONTROL
How can I cut the column data (log_hdr) to match column (pdf_report)?

Any help will be much appreciated

user11978142 wrote:
Yes the code always starts with an alphabetic character and always ends before the underscore character and the prefix is always digital.

And Yes to the second comment WRT 1 to many relationship.

WRT the duplicates I want the info displayed even if there is no matching printpdf

You talk a LEFT OUTER JOIN, then:

See the example below (the statement are just to reproduce the paintings, just use the last query):

WITH xpq_log AS
(
   SELECT '0499SYS003A_06' log_hdr FROM DUAL UNION ALL
   SELECT '0612PV410W1_06' log_hdr FROM DUAL UNION ALL
   SELECT '0609IN002C_06' log_hdr FROM DUAL UNION ALL
   SELECT '2201PA100D1_30' log_hdr FROM DUAL
)
, printpdf AS
(
   SELECT 'SYS003A' pdf_report, 'STOCK FILE PURGE - PRINT WH CONTROL' description FROM DUAL UNION ALL
   SELECT 'PV410W1' pdf_report, 'Description 2' description FROM DUAL
)
SELECT a.log_hdr, REGEXP_SUBSTR (a.log_hdr, '[[:alpha:]][^_]*') AS pdf_report
     , b.description
  FROM xpq_log a LEFT OUTER JOIN printpdf b
       ON pdf_report = REGEXP_SUBSTR (a.log_hdr, '[[:alpha:]][^_]*');

Output:
LOG_HDR        PDF_REPORT     DESCRIPTION
-------------- -------------- -----------------------------------
0499SYS003A_06 SYS003A        STOCK FILE PURGE - PRINT WH CONTROL
0612PV410W1_06 PV410W1        Description 2
2201PA100D1_30 PA100D1
0609IN002C_06  IN002C                                           

Kind regards.
Al

Tags: Database

Similar Questions

  • How to divide the column Date OBIEE

    Hello
    We have the name of the date column: To_Date and the format is DD/MM/YY hh.
    How to divide the date in YEARS, MONTHS, DAY as new columns.
    kindly help on that.


    Kind regards.
    CHR

    Published by: 867932 on November 23, 2011 22:18

    Hi user,

    All 3 functions can be written in RPD too. MDB layer, duplicate the date column-> the mapping tab to column of Goto-> expression-> functions Builder Select-> calendar Date functions / hour-> select DayofMOnth function. The column of your logic formula will look like,

    DayofMonth (YourDateColumn)

    Rgds,
    DpKa

  • Windows Desktop Search 4.0 how to format the column Date in results?

    Is it possible to change the date column in the result pane of Windows Desktop Search 4.0?

    It runs on a Windows 2003 Enterprise Server.

    I have users who need to modify files that arrived today and yesterday, after 17:00.  The date column only displays the time on files including today's date.  Is there a registry setting that I can shape for this column to always display the Date and time?

    Kind regards

    RN

    Hello

    Republish the issue in the Windows Server forum

    http://social.technet.Microsoft.com/forums/WindowsServer/en-us/home?Forum=winservergen

    Thread Windows Date put in - form

    http://social.technet.Microsoft.com/forums/WindowsServer/en-us/122e9210-2842-4E07-84be-8611e17bac7e/Windows-date-formating?Forum=winservergen

  • How to list the columns for a view

    Dear experts

    I know how to list the columns in a table. This easy by querying the data USER_TAB_COLUMNS dictionary.

    But my problem is how to issue a query that returns the columns for a view?

    Thanks in advance

    USER_TAB_COLUMNS stores the metadata for both views.

    Select * from user_tab_columns where table_name = 'YOUR_VIEW_NAME"of order of column_id.    -Replace with your view_name (mandatory course)

    See you soon,.

    Manik.

  • How to check the column updated whereby the package or procedure?

    Hi all

    Can someone help me how to check the column updated by which the package or procedure

    A.Mahesh

    Hello.

    You can check what object is a reference to the table of the column:

    Select *.

    of all_dependencies d

    where d.REFERENCED_NAME = '. '

    And you can find all the links to the object source data column:

    Select *.

    of s all_source

    where s.name = "."

    and s.OWNER = '. '

    and s.TYPE = "."

    and as s.TEXT '%%'

  • How to add the column to Adobe flex mxml or actionsctpt mx:DataGrid?

    I have the simple mxml code

    <mx:DataGrid id="DGG"
                
    editable="true">
       
    <mx:dataProvider>
           
    <mx:Object scheduledDate="4/1/2006"/>
       
    </mx:dataProvider>
    </mx:DataGrid>
    <mx:Button id="SetBut"
              
    label="Set Array as Data Provider"
              
    click="SetDP(); AddBut.visible = true;"
              
    x="100.5"
              
    y="164"
              
    width="211"/>
    <mx:Button id="AddBut"
              
    label="Add a column!"
              
    click="AddCol();"
              
    x="100.5"
              
    y="194"
              
    width="211"
              
    visible="false"/>
    <mx:Script>
        <![CDATA[
            import mx.controls.dataGridClasses.DataGridColumn;
            import mx.collections.ArrayCollection;

            [Bindable]
            public var MyAC:ArrayCollection=new ArrayCollection([{scheduledDate: "4/1/2006", homeTeam: "Chester Bucks"}]);

            public function SetDP():void
            {
                DGG.dataProvider=MyAC
            }

            public function AddCol():void
            {
                MyAC.addItem({scheduledDate: "4/5/2007", homeTeam: "Long Valley Hitters", Umpire: "Amanda Hugenkis"});
                DGG.columns.push(new DataGridColumn("Umpire"));
            }
        ]]>
    </mx:Script>

    I want to add lines to my datagrid table how do such thing?

    How to add the column to Adobe flex mxml or actionsctpt mx:DataGrid?

    (You can place this code in a Flash or AIR application - it compiles without error, but will not add any columns =)

    Change this:

    public void SetDP (): void
    {
    DGG.dataProvider = MyAC
    MyAC.addItem ({scheduledDate: "05/04/2007", homeTeam: "long hitters Valley", umpire: "Amanda Hugenkis"});
    }
               
    public void AddCol (): void
    {
    var dgc:DataGridColumn = new DataGridColumn ("Umpire");
    var ca:Array = DGG.columns;
    CA.push (DGC);
    DGG.columns = ca;
    }

    Dany

  • How to check the manufacturing date of the Z3 Compact?

    How to check the manufacturing date of the Z3 Compact?

    @HerrOdin

    Simple, pull on the flap of the IMEI and search for 14W__

    The first 2 digits are for the year and the last 2 digits are the week

    http://support.sonymobile.com/global-en/xperiaz3compact/Userguide/IMEI-number/

  • How to view the anticipated date of 3 days bb

    Greetings

    How to view the early date to 3 days with bb.

    I was able to view the current in bb, but can not able to display the date fututre.

    Help, please

    concerning

    Anthony singh

    Hello

    Add 3 days to the current date.

    days3 long = (3 * 24 * 60 * 60 * 1000);   MS

    TimeFormat SimpleDateFormat = new SimpleDateFormat ("YYYY/MM/DD HH: mm: EEE");
    timeString = «"+ timeFormat.formatLocal (System.currentTimeMillis () + Days3);»

    Thank you

    Stephenson

  • How to set the current date in the datetimepicker in qml?

    Hello

    Can I know how to set the current date in the DateTimePicker in QML?

     DateTimePicker {
                        id: datePicker
                        mode: DateTimePickerMode.Date
                        title: "Date"
                        value: "2013-11-20"
                        maximum: "2013-11-20"
                    }
    
    Container {
        DateTimePicker {
            id: picker5
            title: "DateTimeQml"
            mode: DateTimePickerMode.DateTime
            value: { new Date(); }
        }
    }
    
  • How to get the last date of 3 days for the current month?

    Hello. Guy

    How to get the last date of 3 days for the current month?

    MY OUTPUT WOULD LOOK LIKE THIS

    JANUARY 29, 2016

    JANUARY 30, 2016

    JANUARY 31, 2016


    GUYS HELP ME / / /...

    SQL > select last_day (sysdate) - level + 1 double connect by level<= 3="" order="" by="">

    LAST_DAY)

    ---------

    29 JANUARY 16

    30 JANUARY 16

    31 JANUARY 16

  • BI Layout Editor - how to display the current date?

    Hello

    Recently used BI Layout Editor (previously using MS Word to create the presentation of the State).

    He seems really nice and easy to use.

    However quick Q - How to display the current date in the layout editor (to show the report run date).

    Any quick suggestions is appreciated.

    Thank you

    Vivek

    Tab displays your selection available.

    It's like how when you insert the table in the Word document and when you select the table, you would see 2 additional tabs such as the design and the tool.

    Can you please insert "Text Element" and select the text element and see if you go to the tab 'text '?

  • Y at - it a paper on how to use the map data the lookup value?

    I'm looking for a documentation where I could find information about the game of card data and how to use the map data configured according to look.

    Any help is very appreciated.

    I found a few threads on data cards:

    http://topliners.Eloqua.com/docs/doc-2434

    http://topliners.Eloqua.com/docs/doc-2817

    http://topliners.Eloqua.com/message/14058#14058

    Maybe that can help you get started

  • How to cut the plan of $118.4 (hk) per month?

    How to cut the plan of $118.4 (hk) per month?

    Cancel your membership Adobe Creative Cloud

  • ToolTip on the column data

    Hello

    I want to display the ToolTip on the column data.
    To this end, I work with the data format.
    under data format I use custom format.
    on the format of data, I wrote the following code.

    < b title = "This" about says month"> month < /b >

    but it demonstrated ToolTip on 'months' and not on real data.

    Is any HTML that display dynamic data, then we can put this code instead of 'months '.

    Please, give me suggestion.

    Concerning

    Prashant

    Did you add the ' @' in your HTML simbol? They must state the values in your column.

    You should have something like months @

    KR,
    A

  • How to normalize the gigantic data up to 3NF

    Hello

    How to normalize the gigantic data up to 3NF

    5 times the same question at the same time. This is not a task of the Oracle, it's main RDBMS design.

    http://en.Wikipedia.org/wiki/Database_normalization

    Werner

Maybe you are looking for

  • How to remove the virus SearchAssist of my browser?

    My browser Firefox 23.0.1 is affected by the virus SearchAssist. I need to know how to remove it manually.

  • stolen Mac

    Hello mac users colleagues that my macbook got stolen and I used find my mac when my mac was online, it says location services are disabled so I can't find the location so I blocked my mac with a password more info on the mac I bought shild hand and

  • Satellite L650 starts but the screen does not appear

    I turn on my laptop does not open the screen, but the computer is on, because I can hear the fan and the lights are all on. Help me!

  • Sims 3 is VERY slow

    Hi, I just installed a game "The Sims 3" in my Windows Vista computer. However, it loads very slowly and may take up to 10 minutes sometimes. Sometimes it hangs for a long time while I play. Is that what I can do about it? Please help, thanks.

  • Why are there updates as long as there is no place for the programs they update?

    I have a Sony notebook with windows XP operating system. Whenever I turn it on, I have more updates. It got to the point that there is no more space left on the drive C for programs that are updated. Why are updates written so sloppily? Would not tak