How to get the part of string before and after a character

Hi all

How to get the string before and after the comma character)

Ex: The string contains the value John Kennedy

I need the output as first stirng - John

Second stirng - Kennedy

Create table names (fullname varchar2 (20));

insert into values of names ("John, Kennedy");

insert into values of names ("papa ibra, Shan");

insert into values of names ('Don Bosco'),

Select * from names;

Expected results

FullName firstname lastname

John, Kennedy John Kennedy

Nicolas, Nicolas Shan Shan

Don Bosco Don Bosco

Please let me know how to proceed

Thank you

Hello

This proves what I said before, on 0 and several commas commas.

If we add these 3 rows to the sample data you posted:

insert into names (fullname) values ("tou").

insert into names (fullname) values (' David, Lloyd, George ");

insert into names (fullname) values ('J, R, R, Tolkien");

then the query I posted earlier produced these results:

FULLNAME FIRSTNAME LASTNAME

-------------------- -------------------- --------------------

John, Kennedy John Kennedy

Nicolas, Nicolas Shan Shan

Don Bosco Don Bosco

TOU tou

David Lloyd, George David Lloyd, George

J, R, R, Tolkien J R, R, Tolkien

If you prefer to get these results:

FULLNAME FIRSTNAME LASTNAME

-------------------- -------------------- --------------------

John, Kennedy John Kennedy

Nicolas, Nicolas Shan Shan

Don Bosco Don Bosco

TOU tou

David Lloyd, George David, Lloyd George

J, R, R, J, R, R Tolkien Tolkien

then you just change line 1:

WITH got_commapos AS

(

SELECT FullName

, INSTR (fullname, ','-1) AS commapos-* CHANGED *.

Names

)

SELECT FullName

, SUBSTR (fullname, commapos 1, -1) AS a first name

SUBSTR (fullname, commapos + 1) in the FORM name

OF got_commapos

;

Tags: Database

Similar Questions

  • How to get the angles of view (horizontal and vertical) camera?

    How to get the angles of view (horizontal and vertical) camera?

    The horizontal and vertical field of VIEW properties are available with the camera_get_physical_property() function.

    Who is using the C API of the photo. I don't think that you can access by using the control of the camera of Cascades.

  • How to get the specific information of hardware and software data center

    How to get the specific information of hardware and software data center with powercli...

    What kind of information you need?

    No matter what Esxi host hardware info., if so could below thread is useful.

    Information about the host material with information on the nic and HBA drivers

  • How can I include spaces in paragraph before and after in the paragraph styles?

    By specifying the paragraph spacing BEFORE or AFTER a paragraph which differs from the CONDUCT ranging from space, how can I include in my paragraph styles? I'm on a MAC under OS Mavericks.

    Yes, by selecting text/para use space before and after.

    Thank you

    Sanjit

  • How to get the channels spot given colors and spot channels length

    File is CMYK format... channel spot color is CMYK we as a spot channel color is c100m50y20k5
    How to get the channel spot color data using javascript? c = ? m = ? y = ? k = ?
    howv to get your channel length n (not the CMYK channel) use javascript?  such as CMYK + spot n-channel 7 = 7

    Please help me

    #target photoshop

    var myDoc = activeDocument;

    var channel = myDoc.channels;

    var number = 0;

    for (var m = 0; m< channels.length;="" m++)="">

    If (channels [m] .kind == ChannelType.SPOTCOLOR) {the number ++}

    };

    Alert (the number + "spotchannels");

  • Illustrator: How to get the overlapping text on transparent and keep gradient and stroke?

    In Illustrator, how can I be part of a transparent text overlapping letter? The circle which lies behind this letter has a gradient and a stroke.  I want the letter to appear that it is hanging around this circle.  In the screenshot, I pointed out the area I want to be transparent with a green arrow. Thank you for your help.

    example.jpg

    Draw a line through the descender of the letter. Select the letter and line, then click on split. Separate the two forms that result and send whatever shape you want behind the ring.

    Result:

  • How to get the view of entity impl and get app module

    I want to know how to access the entity Imp Appmodule as I want to call the entity Impl Module application method.
    And I want to how to call view also entity impl object to get the value of the view attribute object.
    I want to get view object and entity Impl App Module to use in validation

    If you need validate, write this method in the implementation class entity itself. There is no point in writing this method in the app module and call this method from the entity, it's a bad habit. If you want to get some values of a VO, define view accessor in the EO. Through the accessor, you can see the required values.

  • How to get the public key using modulus and exponent

    Dear Sir
    I modulo and exp of the public key, how can I combine the GE the full public key, in the host application. These values are coming from the java card?
    I get these as follows:
                      rAPDU = channel.transmit(new CommandAPDU(getPublicKeyModCommand));
                      if (rAPDU.getSW() != 0x9000)
                      {  
                           System.out.println("Could not get the modulus");
                      }
                      if (rAPDU.getSW() == 0x9000)
                      {  
                           modulus = new BigInteger(rAPDU.getData());
                           arrayPrint(rAPDU.getData());
                      } 
                      
                      rAPDU = channel.transmit(new CommandAPDU(getPublicKeyExpCommand));
                      if (rAPDU.getSW() != 0x9000)
                      {  
                           System.out.println("Could not get exp");
                      }
                      System.out.println();
                      if (rAPDU.getSW() == 0x9000)
                      {
                           exponent = new BigInteger(rAPDU.getData());
                           arrayPrint(rAPDU.getData());
                      } 

    EJP wrote:

    In fact, I was using a deprecated function where the problem arose.

    N ° with the help of an obsolete method does not cause this problem. In fact:

    The stack trace is from this line:

    X509Certificate userCert = createClientCert( user_PublicKey, CA_PrivateKey, CA_PublicKey );
    

    The code for this method has not been demonstrated, so he's probably trying to use BC. The factory key code must have worked very well to get to this day.

    See you soon,.
    Shane

  • Monday the 1st business day of the month of 15 before and after 15.

    I want to choose the 1st Monday with the business day (Y) of a month (january), owned by the 15th of the month and after the 15th of the month.
    Whereas it should be 2 folders, 1 record should be before the 15th of the month with the word 'Monday' & Holiday (N) and 2nd record should be based on the 15th of the month
    with the word 'Monday' & Holiday (N).

    Table:-holiday
    Column
    ---------
    Time_Date - holiday - Time_Day
    2011-01-01 00:00:00 - N - Tuesday

    Please let me know the oracle query.

    Thanks and greetings
    R Rodriguez

    Edited by: 880353 August 19, 2011 05:14

    It's almost like this... just a matter of playing with the SQL to reorganize the command:

    Select
    min (case when TIME_DATE between trunc(sysdate,'MM') and trunc (sysdate, 'MM') + 13 and)
    H.HOLIDAY = ' only then end TIME_DATE to another null) «FIRST»,
    min (case when TIME_DATE between trunc (sysdate, 'MM') + 14 and last_day (sysdate) and)
    H.HOLIDAY = ' only then end TIME_DATE to another null) "FIRST > = 15.
    Holiday h.
    (select next_day (trunc(sysdate, 'MONTH')-1, 'Monday') + 7 *(level-1) double DD
    connect by level<= 5)="">
    where M.DD = h.TIME_DATE

  • How to get the software HP Coolsense works again after the clean install (win7)?

    I recently purchased a DV7 6014TX and upgraded to an SSD and a clean install of the retail version of windows 7 64-bit. I want to know how do HP Coolsense works again? I saved the folder drivers of my original hard drive SW and I so all people. SP52814, I downloaded the installer coolsense, but it doesn't seem to work. Any input on this would be highly appreciated.

    Coolsense also requires HP Support Assistant see links below

    HP Notebook PC - on CoolSense technology

    Download

    HP Support Assistant

  • How to get the malware removal software will run after your infected.

    Malware in the form of XP repair tool has infected my system. I can not get any form of antivirus software or withdrawal from work. He starts, but he is quickly terminated and nothing I've tried has worked. I used the Malware Bytes, Rkill and Hitman Pro to try to get something to clean out the infection. Any suggestions?

    Hello

    Have you read and follow this? There are still manual methods.

    Remove Windows XP Repair (Uninstall Guide)<-- read="" this="" link="" for="" removal="">
    http://www.bleepingcomputer.com/virus-removal/remove-win-7-Internet-Security-2011

    Have you tried to rename (the ladies of malware) programs you need to run a .COM extension?

  • Multiple operating systems. How to get the double boot or sort and what's on the disk images?

    Hello. I currently have Windows XP Home Edition on my desktop. I have an update for Windows Vista Home Premium. Both are 32-bit. I read this linkhttp://windows.microsoft.com/en-US/windows-vista/Installing-and-reinstalling-Windows-Vista. I have a few questions, I would like to precise please.

    Can I add the upgrade to Vista on a separate hard drive? Is there a partition?

    Do I need to install any other program infront of XP or Vista so I can dualboot? I have to if I wanted to add Win7 Home Premium 64 - bit as a bunch of sorting?

    I'm not pure install, I understand that. I'm done with my XP havn't programs, it takes more time than expected.

    Is it possible to create disk images or backups with more than one operating system installed? If I have an upgrade, I don't think that I can remove the previous installed OS (XP Home Edition) and have a Vista disk image work. At least I have clean install and only Vista is? I have Norton Ghost 15 and I wondered if I would be able to drive or backup XP image or upgrading to Vista at all, or together.

    Can an upgrade copy, I change the material at all, or add anything internally?

    XP SP3 on the desktop.

    Hello

    Yes, you need XP on your drive hard first to use the dual boot with Vista, after the restoration of ghosting for 2 hard drives.

    If you only want Vista on the PC, then you will need to use your Vista installation disk to repair and install files on the hard disk Vista.

    As for the reactivation, you should be able to activate again within 3 days on the internet, you may need to phone MS if you can't.

    1) click Start and in the search for box type: slui.exe 4
    (2) press the ENTER"" key.
    (3) select your "country" in the list.
    (4) choose the option "activate phone".
    (5) stay on the phone and waiting for someone to help you with activation.

    Your XP disk is more then likely an OEM version, which means that it is linked to the computer it was installed on.

    So your Vista upgrade could also be tied to the PC you are upgrading to.

    Please keep in mind that my answer is based on the information in your message. More the better I can answer, Slan go foill, Paul

  • How to get the time in hours minutes and seconds subtraction between two varchar t

    Hi all

    I have two variable varchar that has a value like this

    v_outpunch1: = 17: 50:00'
    and v_Shifttime: = 18:00:00 '


    This time I'm subtracting here and in another varchar variable
    who's like that.



    v_EarlyLeaverstimeformat: = ((extrait extrait de (heure de TO_TIMESTAMP (v_ShiftTime, 'HH24:mi:ss'))-(heure de TO_TIMESTAMP (v_OutPunch1, 'HH24:mi:ss') LPAD)), 2, '0'): ': ' |)) LPAD ((extrait (minute de TO_TIMESTAMP (v_ShiftTime, 'HH24:mi:ss'))-extrait (minute de TO_TIMESTAMP (v_OutPunch1, 'HH24:mi:ss'))), 2, '0'): ': ' |)) LPAD ((extrait (seconde de TO_TIMESTAMP (v_ShiftTime, 'HH24:mi:ss'))-extrait (seconde de TO_TIMESTAMP (v_OutPunch1, 'HH24:mi:ss'))), 2, '0');))



    It is not properly subtracting value.

    Thank you

    This works for me...

    SQL> ed
    Wrote file afiedt.buf
    
      1  with t as(select to_date('17:50:00','HH24:MI:SS') as out, to_date('18:00:00','HH24:MI:SS') as shft from dual)
      2  --
      3  select to_char(trunc(sysdate)+(shft-out),'HH24:MI:SS') as diff
      4* from t
    SQL> /
    
    DIFF
    --------
    00:10:00
    

    If you want something different, please report the details according to the FAQ: {message identifier: = 9360002}

  • How to get the peak value

    Can I know how to get the 2 peak values v1 and v2 and 2 duration times t1 t2.

    Since there is a small amplitude noise, difficult to use the Max simplely.

    May need to use a filter such as wavelets or TREE to Denoise it first. Can I know how to use, any Toolbox in labview. How do the curve smooth first.

    Thank you.

    I can't watch your vi now (I'm at work), but if your signals are long enough, you might consider a median filter.  You can set the number of points before and after use.  I found that it is useful for some smoothing problems (not all).

  • How to check before and after in Photoshop?

    Is there a cursor function "before and after", etc. plugin Photoshop cs6 that allows you to see a slider from left to right before and after the image in meansf?

    Hi gropius,.

    From now there is no option if Photoshop to check the image in Photoshop, before and after.

    However, you can consult the following links, they might be useful: Photoshop shortcut: view Original | PhotographyBB

    any keyboard shortcut for comparing before after in photoshop cs3: retouching Forum: Digital Photography Review

    Let me know if it helps.

    Kind regards

    Tanuj

Maybe you are looking for

  • HP PAVILION DV6T: on PCI Express Root Complex

    "Please I have a device cant find adriver for her, in properties under Show details ' ACPI\VEN_HPQ & DEV_0004 ACPI\HPQ0004 * HPQ0004" grip also this message since 'on PCI Express Root Complex"Device Manager"

  • Satellite A205-S6808 - Vista hangs during installation

    Hey all,. I tried to install/re-install my OS Vista on my Satellite 205-6808. But I get a pxe - e61:media test failure check cable. (But the HARD drive is installed correctly) Then he will be inactive for a while then windows green lights flashing in

  • How do I uninstall "windows powershell".

    Recently had to replace the drive hard and now want to re - install using the disc to "Reinstall". Through windows its asking to uninstall "powershell" to proceed. Sorry but I have no idea what to do because its not in Add/Remove Programs list... HEL

  • Windows Vista stops responding.

    Hello I am running Windows Vista on a Lenovo 3000 Y500 computer laptop with Intel Core2Duo and 2 GB of RAM. Recently, the computer began to become completely unresponsive. Everything stops working, even the keyboard and mouse. I have to turn off the

  • Badly distorted audio CD

    Windows 7 pro with HP Comaq 6200 giving badly distorted playback music CD, DVD and Youtube are very good.  Nothing does withdraw as bad.