Hi, I how can i get the middle name of this string inside the query
JONY,KENTH L & PSY
RALF,BENTH & MARIA MORIS
So, inside my query i want to get the middle name of those fields, that are L for the first row and BOSS for the second. the first row have & that indicates there is another name there, so the middle name is L. And also get the first name of the second person if appears after the & character.
how I can do this query:
select substring(********* from table1
result should be:
In general, SQL isn't very good at string manipulation. That's not what it's designed for. You should move such logic into the business layer of your application.
All that being said, if you set up some parameters it is possible to retrieve the data you're looking for... most of the time. So, how would you address the above situation? What are your parsing rules?