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

  • SEARCH
  • Home
  • 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 7511057
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T23:25:57+00:00 2026-05-29T23:25:57+00:00

I am guessing this is a noob question so please bear with me. I

  • 0

I am guessing this is a noob question so please bear with me. I have a column in a mySQL table that contains both first name and last name plus other data (see table below).

fid | uid | value
 5  |  1  | John
 6  |  1  | Doe
 7  |  1  | some other data
 5  |  2  | Jane
 6  |  2  | Doe
 7  |  2  | some other data

What I would like to do is create a query where I split out the first and last names into their own columns for reporting purposes (like shown below).

First Name | Last Name
  John     |   Doe
  Jane     |   Doe

I haven’t seen this question asked before here nor have I been able to Google (perhaps using the wrong keywords). I assume this is relatively simple but it is eluding me.

Thanks.

  • 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-29T23:26:00+00:00Added an answer on May 29, 2026 at 11:26 pm

    You just need to join the table to itself with something like this:

    select first_name.value, last_name.value
    from your_table first_name
    join your_table last_name on first_name.uid = last_name.uid
    where first_name.fid = 5
      and last_name.fid  = 6
    

    You can join a table to itself or join the same table multiple times as long as you use a different alias for each instance of the table.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Sorry if this is a noob question, but I have been given the dubious
I'm guessing this is a simple problem, but I'm just learning... I have this:
I'm guessing this isn't possible, but here goes. I have two tables, and I'm
I am guessing this is a total beginners error. I have a hs-file in
I'm guessing this will be such a newbee question but I hit a wall
This is my first time posting a question here, it has been a valuable
First I'm brand new to JS but have an idea that object classes are
I am guessing this is not possible based on the fact that my Google
I'm mapping a objectified relationship (the many->many mapping table contains properties), following this guide.
I have this statement that im trying to figure out how to use in

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.