Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5933987
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T15:03:02+00:00 2026-05-22T15:03:02+00:00

How do I seperate the Last Name and First Name into new columns? I

  • 0

How do I seperate the Last Name and First Name into new columns?

I have “John & Anna Smith” in one column, I need to separate it into “John & Anna” & “Smith” in two columns. How do I do this?

There is no delimiter when we go from left. While we go from right the delimiter is space. The last sub-string is always the Last Name. The rest is the First Names.

For Example:

“John Smith” –> “John” in column1 and “Smith” in column2

“John & Anna Smith” —> “John & Anna” in column1 and “Smith” in column2

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T15:03:03+00:00Added an answer on May 22, 2026 at 3:03 pm

    Hey, you can try something like this

    SELECT REPLACE('John & Anna Smith', SUBSTRING_INDEX('John & Anna Smith', ' ', -1),'') AS first_name, SUBSTRING_INDEX('John & Anna Smith', ' ', -1) AS last_name;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Right now i have a column called full_name where the first and last name
I have a class that opens text files to grab first name, last name,
I have a column of user names. They are as follows: 'first last middleinitial'
Suppose you have two seperate ASP.NET Web Application projects that both need to use
i have a log file which contains hundreds/thousands of seperate XML messages and need
I want to seperate the data module of a site into an assembly (
I have a method running in a seperate thread. The thread is created and
In our web applications, we seperate our Data Access Layers out into their own
I am trying to have a table header, in a seperate div stay in
I have an online form which collects member(s) information and stores it into a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.