Home » SQL & PL/SQL » SQL & PL/SQL » Find substr after nth occurance of spce
Find substr after nth occurance of spce [message #669882] Tue, 22 May 2018 05:47 Go to next message
purnima1
Messages: 76
Registered: June 2014
Member
hi All,

Could you please help me in finding substring after nth occurrence of white space :

Jack Sparrow SQY778 17JULY17 00J1

after 1st white space >>> output shld be >>> Sparrow SQY778 17JULY17 00J1

after 2nd white space >>> output shld be >>> SQY778 17JULY17 00J1


after 3rd white space >>> output shld be >>> 17JULY17 00J1
Re: Find substr after nth occurance of spce [message #669883 is a reply to message #669882] Tue, 22 May 2018 05:51 Go to previous messageGo to next message
pablolee
Messages: 2881
Registered: May 2007
Location: Scotland
Senior Member
Look at the syntax for Instr function:
instr(string to search, string to search for, start position, occurrence)

Re: Find substr after nth occurance of spce [message #669884 is a reply to message #669882] Tue, 22 May 2018 05:53 Go to previous messageGo to next message
Michel Cadot
Messages: 66808
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

Why don't feedback and follow your previous topic before starting a new one?

And what is your problem with this question? Did you read the documentation about INSTR?

Point 4 of OraFAQ Forum Guide:

Quote:
Post your Oracle DB version to 4 decimal places (SELECT * FROM V$VERSION;).
Re: Find substr after nth occurance of spce [message #669917 is a reply to message #669882] Thu, 24 May 2018 04:53 Go to previous messageGo to next message
purnima1
Messages: 76
Registered: June 2014
Member
Thanks it was helpful. I have used subst and instr
Re: Find substr after nth occurance of spce [message #669918 is a reply to message #669917] Thu, 24 May 2018 05:38 Go to previous message
Michel Cadot
Messages: 66808
Registered: March 2007
Location: Nanterre, France, http://...
Senior Member
Account Moderator

OraFAQ Forum Guide, point 12:

Quote:
If you found an answer yourself, post it. That way we know the issue is resolved and we might learn from it.

Still not following the rules.

Previous Topic: Insert values from different tables in a single statement
Next Topic: Adding up graphs
Goto Forum:
  


Current Time: Wed Jan 29 02:55:20 CST 2020