Parse a String with FIRSTNAME MI and LASTNAME but not always a MI

Anyone,
can I write a single clause to parse a column that cotains first name, middle initial and Last name but the Middle initial is sometimes there and sometimes not?
Like this:
Steven F Abbott
Mikel Allums (Steve)
Pedro A Arroyo
Daniel R. Hasbrook
Steve G Ball
Ernie C Bloecher
Richard Carrillo
James M Chamberlain
I need data seperated.
I have:
SUBSTR(NAME, 1, (INSTR(NAME,' ',1,1)-1)) "FIRST_NAME",
SUBSTR(NAME,(INSTR(NAME,' ',1,1)+1), LENGTH(NAME)) "LAST_NAME",
But that middle initial presents problems and I see it as first letter in last name but if I chnage the search for space to second occurance I get the whole name:
SUBSTR(NAME,(INSTR(NAME,' ',1,2)+1), LENGTH(NAME)) "LAST_NAME",
Any help would be greatly appreciated.
Thanks,
Miller

may this eaxmple is little better if there is only one name then will display as first anem only
SQL> WITH T AS
  2       (
  3          SELECT 'john smith' col1  FROM DUAL
  4          UNION ALL
  5          SELECT 'Derick R Alias' FROM DUAL
  6          UNION ALL
  7          SELECT 'Michel M john'  FROM DUAL
  8          UNION ALL
  9          SELECT 'Kiren'  FROM DUAL)
10  SELECT (CASE
11             WHEN INSTR (col1, ' ') = 0
12                THEN col1
13             ELSE SUBSTR (col1, 1, INSTR (col1, ' ') - 1)
14          END
15         ) first_name,
16         CASE
17            WHEN INSTR (col1, ' ', 1, 2) > 0
18               THEN SUBSTR (col1, INSTR (col1, ' '), 2)
19            ELSE NULL
20         END middle_name,
21         (CASE
22             WHEN INSTR (col1, ' ', 1, 2) > 0
23                THEN SUBSTR (col1, INSTR (col1, ' ', 1, 2) + 1)
24             WHEN INSTR (col1, ' ') = 0
25                THEN NULL
26             ELSE SUBSTR (col1, INSTR (col1, ' ') + 1)
27          END
28         ) last_name
29    FROM T;
FIRST_NAME     MI LAST_NAME
john              smith
Derick          R Alias
Michel          M john
Kiren

Similar Messages

  • I am having problems with my wifi on my ipad its stopped connecting, its fine with my laptop and iphone but not ipad - I want to know if I can set up by plugging in to itunes rather than manually as it wilask me to connect to wifi to set up and I cant!

    I am having real problems with wifi on my ipad it was fine but for the last week or so wont connect! my laptop and iphone are connecting fine, I have tried everything! back up and restore from back up and still no joy so I am thinking of restoring the ipad to a new one the worry for me is with this is when you set it up you go through the instructions and it asks you to connect to a wifi network and as it wont Im worried I wont be able to set it back up so need to know if I plug into itunes can I set it up this way? can anyone help me please Im going crazy with this!!!

    BOB we need you urgently
    Perhaps Bob will see this thread, he is the professor in these cases.
    You do not use a WEP password but wpa/wpa2 on router and equipment.
    All equipment connects to WiFi, but for your iPad.
    Even with all other equipment WiFi off, you cannot connect your iPad.
    Your iPad connects to other WiFi nets correctly.
    All resets etc done on iPad and Router.
    Still I am not sure it is your router for sure, frustrating...
    I want to test 2 other things:
    1. in your iPad, set everything OFF in Settings/Cellular, turn off/then/on your WiFi, and see whether it will still not connect...
    2. If that does not do it: disconnect the router as well as the modem from the power, for 15 seconds, then reconnect the modem, let it fully start, then reconnect the routet let it fully start, turn of your WiFi in iPad, then on, and see whether it will connect.

  • Dark Prints with Photoshop CS3 and CS4 but not Lightroom

    Hi, To start,I have calibrated my dell monitor with eye-one pro as well as my epson 7800. i am running vista 64 bit on my PC...
    When i use photoshop (CS3 or CS4) the images look fine on the screen and come out really dark on the printer. When i use lightroom, the images look fine on the screen and fine on the printer.
    Any guidance on how to "fix" photoshop would be appreciated. By the way, in photoshop print dialogue, i color manage the document, photoshop manages the color, the printer profile is set to the I-1 custom printer profile, rendering is perceptual, and black point compensation is checked.
    Thanks,
    Joe

    I manage color and service bureau printing at the college I work for, and we've been fighting the upgrade to CS4 for some time. Here's what we have so far.
    Apple dual G5 machine with 10.5.8
    Adobe PS CS3
    Adobe PS CS4
    3 x Epson 4800 Pro printers using an IP connection and using Driver version #6.11
    We manage color with custom created profiles in eyeOne with eyeOne pro hardware.
    When moving to CS4 for printing prints have gond dark and the color has taken an odd shift.
    When printing with CS3, we get consistent color and density
    All things being equal in the print settings for each version of PS.
    I have heard that CS4 addresses the printing system differently (using an updated printing api from Apple) is this true?
    When running prints from within another app (any app really) that prints directly through the OS, we get similar results as CS4.
    The best explaination that we've been able to get is that the (epson) print driver is operating on the older api calls, and that when the OS (or CS4) is operating on the newer calls, the color and density issues arise.
    Can anyone verify this?

  • Tutorials on the Apple Website play in Safari and Chrome, but not always in Firefox. Java and Flash plug ins are up to date.

    I was trying to play the Time Machine video tutorial on the Apple Website (I have an imac 10.6.6) and it won't play in Firefox, but it will in Safari and Chrome. This has happened before but then seemed to fix itself. Other videos (Youtube for eg.) play fine. All plugs (Java and Flash) are up to date. Just wondering why this could happen.

    I have had this problem for a few days, no sound in Firefox, but IE and WMP (offline) have sound, this is a Firefox ONLY problem, so the volumes are all set correctly and the drivers and needed files are there, I've tried every fix that people have suggested on Google like checking the flash player settings, creating the "missing.reg" registry file and importing it, etc...
    nothing works, I may just have to switch to Safari or Chrome, I watch a lot of video online (Youtube, ESPN3, NFL.com, etc.) so this is a huge problem...

  • Update  FirstName,MiddleName and LastName  of Contact Employee of BP via DI

    Hi,
    Iam using SAP BOne 8.8 SP:00  PL15   and i need to add a BP using DI and i also need to add Conatct Person information for that BP. But the FirstName,MiddleName and LastName Fields of the contact person is not exposed through the DI.
    Is there any way to add or update those fields through ( FirstName,MiddleName and LastName ) DI
    Thanks & Regards
    Rejish

    If it's not exposed to the DI, you can not do it with the DI or DTW so it will have to be done through the application

  • My Outlook/iCloud calendar invites to others appear to work on my end and sync with my PC and mobile, but when other people "accept" the invite, it will not populate/add in to their calendar. How can i fix this without turning off iCloud?

    My Outlook/iCloud calendar invites to others appear to work on my end and sync with my PC and mobile, but when other people "accept" the invite, it will not populate/add in to their calendar. How can I fix this without turning off iCloud?
    I am at a new office that uses Outlook (not Outlook Exchange) which does not sync with my mobile... I just got iCloud set up on my PC to sync my contacts, calendar, reminders, etc... The sync worked (not without flaws, but the other issues seem solvable... I think), so that i can now see all my appointments on both my phone and on my PC. The problem I am having is that iCloud moved all of my calendar items from Outlook into iCloud calendar and now when I send out meeting/calendar invites the recipients may accept them, but the meeting does not get added to their calendar. This is a huge problem and may mean that i need to turn off iCloud.
    Does anyone know how to fix this?
    Thanks!

    I am replying to my own post here as I seem to have fixed the problem.
    I do have some calendars that are shared. Some of those are shared with users who have time zone support turned on. So i activated time zone support on my iphone, then deleted my icloud subscription. I then signed in to icloud again and voila... problem solved.
    It is a weird one as the other calendar views were always fine and when you opened an event that appeared in the wrong day (on list view), the correct date of the event was shown in the information...
    one more bug in a complicated system I guess

  • Hi! I have a library of around 1000 songs on my iTunes, I recently synced my phone and all was lost, my partner has the same songs on hers with a different sign in, but not backed up anywhere, any suggestion on how I can store her tunes in my account ???

    Hi! I have a library of around 1000 songs on my iTunes, I recently synced my phone and all was lost, my partner has the same songs on hers with a different sign in, but not backed up anywhere, any suggestion on how I can store her tunes in my account ??? Then sync them to mine? When I sign her phone into her account I get a message warning that if I sync the dogs on her phone will be replaced by the ones in the library! But as there are no songs there I'm reluctant to continue!!! Please help this non techi guy.!!!!!

    Hello Solid Buck,
    Thank you so much for providing the details about the duplicate song issue you are experiencing.  It sounds like you would like to remove the duplicate songs that will not play on your iPhone, but when you connect it to iTunes, iTunes only shows you one copy of the song on your iPhone. 
    In this situation, I recommend deleting the individual songs that do not play directly from your iPhone.  I found the steps to do this on page 61 of the iPhone User Guide (http://manuals.info.apple.com/en_US/iphone_user_guide.pdf):
    Delete a song from iPhone: In Songs, swipe the song, then tap Delete.
    Thank you for using Apple Support Communities.
    Best,
    Sheila M.

  • Hi guys.Got a problem with my iPhone 5. I bought it in a shop 4 month ago. After I got a visitor with iOS 7 on his phone he would like to charge his phone with my Laptop and cable.But when he plugged it in it showed a message wich says: " This cable or ac

    Hi guys.Got a problem with my iPhone 5. I bought it in a shop 4 month ago. After I got a visitor with iOS 7 on his phone he would like to charge his phone with my Laptop and cable.But when he plugged it in it showed a message wich says: " This cable or accessory is not certified and may not work reliably with this phone".
    How is this possible? I then phoned the shop and told them my problem. When I gave them the details I also found out that the imei No. in the iPhone is the same as on the original box. But the the Serial numbers are different. I already try the support centre but I’m over the 90 days.And there is no Apple Store in Namibia. I hope someone can help me here. Thanks, Ralfar

    You are right, but how could i send it to Apple? when the phone company first replaced my iphone they had in stock alots of iphones and they just sent mine back to Apple and gave me a new one, so all i did is to give them my phone, but now how could i sent it to Apple? and i cant send it by myself, and the store wont do that, its a lost for them.. so sending it to Apple wasnt an option from the begining.
    and for the record, i dont think the store where i bought it is an authorized shop.. its just a store who boughts phone's from Apple in a low price and sells it in much more money..

  • Ever since upgrading to Mountain Lion, my AOL messages sometimes, but not always open with a blank page. If I open AOL in Firefox, the messages open fine.  This does not happen with any messages by any means, and it is not any type of certain message

    Ever since upgrading to Mountain Lion, my AOL messages sometimes, but not always open with a blank page. If I open AOL in Firefox, the messages open fine.  This does not happen with any messages by any means, and it is not any type of certain message. In fact, in the same screen I can often open an email from the same sender with email intact. This is weird. Sometimes I close the page and open a new page. Sometimes that works and sometimes it does not. It is a very annoying thing.

    Hi,
    When you start Messages fro the first time you are asked for an Apple ID
    When this is verified and entered it appears in Messages Menu > Preference > Accounts and is Enabled.
    The App should have also picked on on those iChat Accounst you had before.
    These should be Enabled if they were when you last used iChat.
    Exactly which "Accounts" are logged in can be seen in Message Menu > Accounts and will include the iMessage "Account" and Bonjour.
    In the Window menu you will see CMD +0 for the Messages window and CMD+1 for the "Buddies" window which is a combined list at this stage.
    Go to the Preferences > General Section and Untick the "Collect all accounts into one list".
    This will give you separate iChat type Buddy lists.
    You can check if that account/Buddy list is set to Invisible or if in the Preferences > Accounts > Security you have settings that will block some people from seeing you as On line.
    You are saying Buddies can see you as On Line which implies they are still sending to your AIM based Names (@Mac.com is a valid AIM Screen Name)
    I am not sure from your post if you are trying to iMessage their email IDs thinking they are Apple IDs and that they are using Messages as well.
    There is no Buddy list for iMessages side
    No-one can tell you are "On Line" until they have your details in the "To" spot in Messages with the correct iMessaged contact info (iPhone Number or Apple ID)
    Obviously an Apple ID can be an email or look like one.
    In some cases they are also valid AIM Screen Names as well.
    In the case or the @mac.com name you may have linked this Apple ID to iMessages as well.
    11:31 PM      Saturday; August 11, 2012
    Please, if posting Logs, do not post any Log info after the line "Binary Images for iChat"
      iMac 2.5Ghz 5i 2011 (Lion 10.7.2)
     G4/1GhzDual MDD (Leopard 10.5.8)
     MacBookPro 2Gb (Snow Leopard 10.6.8)
     Mac OS X (10.6.8),
    "Limit the Logs to the Bits above Binary Images."  No, Seriously

  • HT4759 My mac mini is not updating its software to OSX Lion v10.7.5.  I would like to use iCloud on my desktop along with my iphone and ipad but the auto updates are only upto 10.6.8.

    My mac mini is not updating its software to OSX Lion v10.7.5, which I need for iCloud.  I would like to use iCloud on my desktop along with my iphone and ipad but the auto updates are only upto 10.6.8. 

    You need to get the newer version from the Mac App Store.
    (70404)

  • When i try to update my itunes on my pc i keep getting the messaage that there was a problem with the installer and it could not finish. how do i fix this? i`ve tried to download 3 times already.

    when i try to update my itunes on my pc i keep getting the messaage that there was a problem with the installer and it could not finish. how do i fix this? i`ve tried to download 3 times already.

    Hi
    I've got a similar problem.  iTunes v10.2 worked fine, but when I tried to update it to 10.5 I got a 'Bonjour' error.  I eventually solved that but I still couldn't upgrade to 10.5, so I deleted every single Apple, Quicktime, iTunes, etc file on my PC using Revo Unistaller (because the normal Windows Add/Delete programs wouldn't work) but now, when I install the latest iTunes version from scratch (on XP SP3), it says: "the installer encountered errors before it could be configured.... your system has not been modified" 
    Any ideas?
    Rick

  • My iphone 4 after update ios wont turn on and stuck in restore with apple logo and loading bar not move

    When I update the ios on my Iphone 4 it wont turn on and I tried to restore it, but it stuck in restore with apple logo and loading bar not move at all, I contact apple support and they tried to help me but nothing work, then they told me to send it to replace it and I need to pay $149, that's mean if anybody has any problem with his iphone even the problem from apple software you need to pay, that's not fair at all.... I will try to sale all our apple device and by Samsung device to resolve this problems.

    I believe this means that it is bricked, just sell it for parts, to someone like me

  • Blank error message with ? appears and PDF does not open in Browser (IE11) when clicking link to open pdf. PC - IE11 Acrobat 9.0

    Blank error message with ? appears and PDF does not open in Browser (IE11) when clicking link to open pdf. PC - IE11 Acrobat 9.0
    Cannot access in browser PDF files unless blank box is closed and then website address is clicked on again in browser address bar and page reloaded.
    Uninstalled Acrobat 9, reinstalled, still same problem.
    Help please!

    Yes I can it only happens in the browser..
    I reinstalled Windows on my machine and started over a couple of weeks ago.
    When my desktop started up I didn’t have Acrobat installed and clicked on a pdf file and the open with xxx dialogue box came open.
    I chose a different program as Acrobat wasn’t installed yet so it associated pdf files with another program.
    Later Installed Acrobat and couldn’t associate the pdf file with acrobat so I went into Folder Options and manually associated PDF files with Acrobat.
    Ever since then I get the error when something is downloaded and opened in the browser.
    Works fine everywhere else and when I cancel the blank error, highlight the web address and press enter to reload it works 90% of the time.
    Not sure what to do..

  • I have a Nikon AW100 and I use a SanDisk for the memory and I download that with My Pictures and Videos but I cant get my videos onto IMovie

    I have a Nikon AW100 and I use a SanDisk for the memory and I download that with My Pictures and Videos but I cant get my videos onto IMovie

    Hi
    I import all from my Nikon - into iPhoto
    Then closing it and opening iMovie
    In the Event window like
    • iPhoto-videor - Here I find mine.
    Yours Bengt W

  • Hierarchy with HIESID 2 and SVER  was not found

    Hello Experts,
    I am in dire need, as I need to change/add some authorizations.
    When selecting a hierarchy authorization to add, I receive the following error:
    "The hierarchy with HIESID 2 and SVER  was not found"
    this happens not only when I want to add an authorizations, but also when looking up existing ones and trying to access the authorization node.
    I have searched the forum and the guidelines but unfrtunately I did not find any helpful information.

    Found a note that can correct this:
    Note 1530624 - RSRHIEDIR_OLAP inconsistency,Deleted entries of INFOAREAHIER

Maybe you are looking for