Splitting of a column and get the strings as different columns

I had a table with lets say 4 columns.

age sex nationality name

ABC - xyz 20 M IND
def - uvw F 30, US

Now I want 5 columns with 1 name, first name as 2nd, as 3rd age sex nationality as 4th, 5th.

nationality of first name last name age sex

ABC xyz 20 M IND
def uvw F 30, US

How to get results like that since the above mentioned table game.

TIA.

Published by: 986155 on March 12, 2013 05:35

Published by: 986155 on March 12, 2013 05:35

Use SUBSTR/INSTR:

with t as (
           select 'abc xyz' name,20 age,'M' gender,'IND' nationality from dual union all
           select 'def uvw',30,'F','US' from dual
          )
select  substr(name,1,instr(name,' ') - 1) name_part1,
        substr(name,instr(name,' ') + 1) name_part2,
        age,
        gender,
        nationality
  from  t
/

NAME_PA NAME_PA        AGE G NAT
------- ------- ---------- - ---
abc     xyz             20 M IND
def     uvw             30 F US

SQL> 

SY.

Tags: Database

Similar Questions

  • How to get the string (specified by row and column) of txt file with labview

    Hello world

    How to get the string (specified by row and column) of txt file with labview

    THX

    As far as I know, a text file has no column.  Be more specific.  Do you mean something like the 5th word on line 4, where the words are separated by a space, and lines are separated by a newline character?  You can read from the spreadsheet String function and set the delimiter to a space.  This will produce a 2D channels table.  Then use the table to index and give the line number and column number.

  • Starting from two data tables, how do you get the values in two columns using values in a column (values get col. If col. A is not null values and get the pass. B if col. A is null)?

    Two tables provided, how you retrieve the values in two columns using values in a column (the pass get values. If col. A is not null values and get the pass. B if col. A is null)?

    Guessing

    Select nvl (x.col_a, y.col_b) the_column

    from table_1 x,.

    table_2 y

    where x.pk = y.pk

    Concerning

    Etbin

  • Search and replace the string formatting

    Hello

    I try to do a search and replace the formatting of a string.

    In the example, I'm looking for the string 'SUCCESSFUL', but it must also begin by usbflash and some number + PASSED.

    I can't get the format to have a number between 1 and 99. The number of replacements should add up to 6 in this case. I tried with \d for any number, and I also tried [1-99].

    Make a right-click on the function search and replace the string.  There is an option to use regular Expressions.  Then give it a try.

    EDIT: You need to set the entry replace all to TRUE.

  • Try to use casStubs.jar classes and get the parameters of the analysis

    I went into class files available in casStubs.jar and was trying to come up with a script in the AppConfig.xml to connect to the CAS server and get the State of analysis and measures. I tried this option because the com.endeca.eac.toolkit.component.cas.ContentAcquisitionServerComponent class gives me these features.

    + < id script = "CheckCrawlStatus" > +.
    + < bean-shell-script > <! [CDATA [+]

    Import javax.xml.namespace.QName;
    com.endeca.cas.wsdl import. *;


    final String wsdlUrl = "http://" "${cas.host} '+': ' + ' ${cas.port} ' + ' / case? WSDL "; +
    final name of QName = new QName ("http://endeca.com/itl/cas/2010-07", "CasCrawlerService");
    CasCrawlerServiceLocator service = new CasCrawlerServiceLocator (wsdlUrl, name);
    CasCrawler robot = service.getCasCrawlerPort ();

    String crawlName = "myFirstCrawl";
    CrawlId crawlId = new CrawlId (crawlName);

    Metric [] metricArray = crawler.getMetrics (crawlId);
    + / / rest of the code to retrieve the crawl settings.

    +] > < / bean-shell-script > +.
    + < /script > +.

    Unfortunately, I still get connection refused to exception: ' java.net.ConnectException: connection refused ". My wsdl case load properly in my browser.
    Any ideas on gaps in the code or the missing configuration in the CASE or DT or platformservices?

    Thank you
    Dev

    Try to explicitly set endpoint to service before obtaining the port. So, if you connect to localhost:8500:

    service.setCasCrawlerPortEndpointAddress ("http://localhost:8500/AR"); ")

    You can substitute your host/port settings. This call is normally done through the box tool component wrappers, but since you are directly using the stubs of service, you will need to set the end point. Without this, the stubs use a test port that do not match your.

    Best
    Brett

  • get the strings '? ' instead of strings stored in the db

    Hello

    I migrate an application from Weblogic 8 to 10 and Oracle 9i and 10g

    I question my database by calling a procedure stored that paintings of buildings of type which is defined like this:

    CREATE OR REPLACE
    TYPE 'XXXXX '. "' STRING_ARRAYTYP ' IS THE TABLE OF 40;

    I run a CallableStatement and get the berries via cs.getArray (stored in a java.sql.array).

    In the field of data debug mode, I get a byte []: [-120, 1, -2, 0, 0, 2, 93,-110, 1, 3, 0, 8, 50, 48, 48, 56, 48, 51, 49, 51, 8, 50, 48, 48, 56, 48, 51, 49, 51, 8, 50, 48, 48, 56, 48, 51, 49, 51, 8, 50, 48, 48, 56, 48, 51, 49, 51, 8, 50] 48-48, 56, 48, 51, 49, 51, 8, 50, 48, 48, 56, 48, 51, 49, 51,...]

    When I convert it to a string in debug mode, I give myself: "[special characters] 200505252005052520050525200505252005052" who are my data.

    but when I get the result set and I call rs.getString (2), I get a '? ' string (after rs.next () call of course)

    The application worked before we migrate.

    Any idea?

    '?' is the replacement for a character unknown character (in an unknown character) so I suggest you add orai18n.jar in your classpath. Is the jar of Oracle that supports all charset conversions. The JDBC jar does support a few games of characters.

  • Can not good press the mouse on the name of the file and get the option of e-mail

    Can not good press the mouse on the name of the file and get the option of e-mail

    Hello! If I understand your question, you want to right-click on a file and attach it in Mail. To do this, click on the file with two fingers on the touchpad, or control + click on the file, select 'Share', then 'mail '.

    I hope this helps!

  • I can't sync my phone to my computer and get the message that my phone doesn't have the latest version of Itunes. I downloaded the latest version on my mac, but what I do on my phone. I'm used to be able to synchronize the two.

    I am more able to sync my I phone on my Mac and get the message that my phone cannot be used because it requires a newer version of iTunes. He tells me to go to www.itunes.com to download the latest version of iTunes... I downloaded the latest version on my mac, but what I do on my phone? I used to be able to sync the two and now I can't even download the photos from my phone on my mac...

    iOS9 on a mobile device requires iTunes 12.3 or higher, which in turn requires a computer running OSX 10.8.5 or higher.  Update of the system only checks the updates for the current version of the system you run, but that itself can be updated.  It may or may not be possible to upgrade your computer to the system requirements. Find your computer on the web site of http://www.everymac.com model and near the bottom of the specification of the system section, he will tell what versions of the operating system, it is able to run. If you can not run a newer system, you will not be able to sync this phone to your current computer. If she can run 10.8.5 or higher, you can either buy a download for Apple OSX 10.8 Mountain Lion code online, or you can try to install the free El Capitan OSX 10.11.  El Capitan can run slower on older machines and require the additional purchase of RAM.  Making a big jump in versions of system is also more likely to affect the old software.

    At el capitan Snow Leopard, it will make my macbook is slow?  - https://discussions.apple.com/thread/7412959

    Mountain Lion 10.8 purchase link United States of America - http://www.apple.com/shop/product/D6377Z/A/os-x-mountain-lion

    Mountain Lion 10.8 purchase link U.K. - http://www.apple.com/uk/shop/product/D6377ZM/A/os-x-mountain-lion

    Course OSX Upgrade General information, including configuration required - http://www.apple.com/osx/how-to-upgrade/

  • photos has not been loaded for weeks (usually the browser chrome on PC windows at work).  I tried now on some other computers and get the same error message and I report every time.  can I do or just wait for someone to fix it

    photos has not been loaded for weeks (usually the browser chrome on PC windows at work).  I tried now on some other computers and get the same error message and I report every time.  is there anything I can do or just wait for someone to fix it?

    If you want any help here, you'll have to tell us what the error message.

    Which report you errors to?

  • Today cell 9.7 Pro wifi iPad receipt. No SIM card installed. I guess I can go to the carrier and get the SIM on their part is there a reason I would need the Apple SIM card?

    I got my Pro iPad with wifi and cell phone. There was no SIM card. I'll go to the carrier and get the card SIM on their part is there a reason I need Apple SIM card?

    Apple SIM card to activate the iPad with more companies that I believe except Sprint - if you can get a SIM card from your service provider, then you would not fail the card SIM Apple

  • Outlook Express keeps trying to compact my messages. I'm unable to post messages and get the Error 0x800ccc0d code and I can not remove outlook Express

    Outlook Express keeps trying to shoot my messages several times per day.
    I'm unable to view messages in Outlook Express and get the code of Error 0x800ccc0d
    I'm unable to remove Outlook Express from my computer, I did not need it that I use Windows live mail.
    Any ideas on how to stop this nuisance.

    Windows Search is installed?

    You must tell Windows Search to stop indexing OE.

    In the control panel. Indexing Options. Change. Clear the check box for Outlook Express.

  • Cannot print the income tax from 2012 on a Lexmark X 1185 and get the message "Prop Res DLL was not loaded"

    Original title: "Prop Res DLL not loaded".

    Try printing the income tax from 2012 on a Lexmark X 1185 and get the message "Prop Res DLL not loaded" How can I load it? Typically get this message when I print review copy. My system is Windows XP.32 bits

    Hi Robert,.

    I would be grateful if you could answer the following questions:

    1. did you of recent changes made to your computer?

    2. which antivirus app do you use?

    Here are a few troubleshooting steps that you can try to solve this problem.

     

    Method 1: Let's uninstall and reinstall the Lexmark X 1185 printer drivers.

    To uninstall the printer software, see the following link.

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


    Restart the computer, visit the following link and install the printer drivers.

    http://support.Lexmark.com/index?ProductCode=LEXMARK_X1185&page=product&searchID=1368834464501&locale=en&UserLocale=en_US#1

    If the method above does not work, follow the steps in the next method.

    Method 2: Error Message When you try to print or save a document in OneNote 2007 or in Word 2007: "Prop Res DLL not loading" or "Cannot load Library DLBAPRP.dll"

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

    Note: suggested above steps are applied to your scenario as well.

     

    If you have additional problems, please reply to this post and we will be happy to help you further.

  • Windows XP trying to update and get the error: another installtion progresses.

    original title: Windows XP, try to update and get the error: another installtion progresses.   That all before you proceed with this installation. How can I know what is the installation and the status?

    Windows XP trying to update and get the error: "another installtion progresses.   That completes before proceeding with this installation. "How can I know what is the installation and the status?

    Hello

    1. are you referring to Windows update?
    2 have you made changes on the computer before this problem?

    Please answer these questions and to provide more specific information on the issue. This could help us help you better.

    You can check the question in the clean boot state.

    From your computer by using a minimal set of drivers and startup programs so that you can determine if a background program is interfering with your game or program. This type of boot is known as a "clean boot".

    Reference:
    How to configure Windows XP to start in a "clean boot" State
    http://support.Microsoft.com/kb/310353

    When you are finished troubleshooting, follow these steps to reset the computer to start as usual:
    a. click Startand then click run.
    b. type msconfigand click OK.

    The System Configuration Utility dialog box appears.

    c. click on the general tab, click Normal Startup - load all device drivers and services and then click OK.
    d. When you are prompted, click on restart to restart the computer.

  • KB2656374 update failed to install and get the error code 80070020

    Try to install update KB2656374 and get the error code 80070020. How can I fix this please?

    Hello

    1. who is the antivirus installed on the computer program?

    2 have you made any changes to the computer before the show?

     
     

    Perform the steps described in the article:

    You receive error 0 x 80070020 when you use the Windows Update Web site or the Microsoft Update Web site to install the updates

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

     
    WARNING: Antivirus software can help protect your computer against viruses and other security threats. In most cases, you should not disable your antivirus software. If you need to disable temporarily to install other software, you must reactivate as soon as you are finished. If you are connected to the Internet or a network, while your antivirus software is disabled, your computer is vulnerable to attacks.
     
     

    I hope this helps.

  • I'm running Windows SP2 of Visa and get the following message is displayed at startup: "sasnative32 file not found Autocheck ignored."

    sasnative32 not found

    I'm running Windows SP2 of Visa and get the following message is displayed at startup:

    'sasnative32 file not found that autocheck ignored. '

    I found this message in the registry and deleted but it keeps reappearing.

    It does not seem to cause operational problems, but I want to fix.  Any suggestions?

    The BootExecute key should contain autocheck autochk *. This measure of Chkdsk to run at startup.

    You have all Tune Up or optimization programs installed? It is possible, it is distributed with a different brand.

    You can determine what is written in the registry key by using the Process Monitor program

    http://TechNet.Microsoft.com/en-us/Sysinternals/bb896645

    If you have not used before, there is an introduction to use it here:

    Windows Sysinternals Primer: Process Explorer, Process Monitor and more. Tech· Ed 2010 North America | Channel 9

    If the value has been restored in the register at the time wherever you can connect, you will need to use logging to start. This can significantly slow down the boot.

    You may be able to determine what is responsible for disabling the departure of items using msconfig.

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

Maybe you are looking for