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 8633821
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T09:33:42+00:00 2026-06-12T09:33:42+00:00

Alright let me explain my question with example We have 1 table This table

  • 0

Alright let me explain my question with example

We have 1 table
This table contains

Id
Name
Number

Now example

1 House 4
2 Hospital 3
3 Airport 1
4 Station 2

Now when fetching as select * from table

I want to replace third column number values with that number representing Name

So example of fetching

1 House Station
2 Hospital Airport
3 Airport House
4 Station Hospital

How can i do this ? thank you

  • 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-06-12T09:33:43+00:00Added an answer on June 12, 2026 at 9:33 am
    select t1.id, 
           t1.name,
           t2.name as name2
    from your_table t1
    left join your_table t2 on t1.number = t2.id
    

    You can join the same table twice to replace the number with the name. The on contidion in the join matches the table again and then you can select the name from that table (t2)

    SQLFiddle Example

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

Sidebar

Related Questions

Alright let me explain my question with example We have a table that contains
Alright. Now this question may come to you weird but i have to solve
Alright, let's say I have a table that looks like this: ID | DATE
Alright so let me explain what I'm doing and then I have a couple
Alright, so let's say I have a database with a table named COMPANY_PARAMETERS that
Alright, let me start with an example. I have a bunch of items and
Alright, I'm having a hard time explaining this, let me know if I should
Alright so I have a task, that I have to let the client try
Alright so I have no idea how to even begin doing this But basically
Alright, let's say that I have the following markup: <div class=ticker> <p>News Item One.

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.