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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T07:40:10+00:00 2026-05-31T07:40:10+00:00

Say I have two tables: mysql> show columns from profiles; +————–+————–+——+—–+———+—————-+ | Field |

  • 0

Say I have two tables:

mysql> show columns from profiles;
+--------------+--------------+------+-----+---------+----------------+
| Field        | Type         | Null | Key | Default | Extra          |
+--------------+--------------+------+-----+---------+----------------+
| id           | int(11)      | NO   | PRI | NULL    | auto_increment | 
| full_name    | varchar(100) | NO   |     | NULL    |                | 
| date_of_birth| date         | NO   |     | NULL    |                | 
+--------------+--------------+------+-----+---------+----------------+
mysql> select * from profiles;
+-------------------+----------------+
| id  | full_name   | date_of_birth  |
+-----+-------------+----------------+
| 1   | John Smith  | 2000-01-01     |
| 2   | Anna Smith  | 1995-01-03     |
+-----+-------------+----------------+

and

mysql> show columns from language_en;
+--------------+--------------+------+-----+---------+----------------+
| Field        | Type         | Null | Key | Default | Extra          |
+--------------+--------------+------+-----+---------+----------------+
| column_name  | varchar(100) | NO   |     | NULL    |                | 
| label        | varchar(100) | NO   |     | NULL    |                | 
+--------------+--------------+------+-----+---------+----------------+
mysql> select * from language_en;
+-------------------+----------------+
| column_name      | label           |
+------------------+-----------------+
| id               | ID              |
| full_name        | Name            |
| date_of_birth    | DOB             |
+------------------+-----------------+

I want to run a query that returns:

+-------------------+----------------+
| ID  | Name        | DOB            |
+-----+-------------+----------------+
| 1   | John Smith  | 2000-01-01     |
| 2   | Anna Smith  | 1995-01-03     |
+-----+-------------+----------------+

Which is just the query “SELECT * FROM profiles” but using the labels instead of the column names. How do I do this using the column names and not entering them directly?
I know I can do:

SELECT id AS ID, full_name AS Name, date_of_birth AS DOB FROM profiles

However I was after something dynamic like:

SELECT id AS language_en.label FROM profiles, language_en WHERE language_en.column_name = profiles.COLUMN_HEADER????

Any help would be much appreciated

  • 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-31T07:40:12+00:00Added an answer on May 31, 2026 at 7:40 am

    Short answer: I don’t think so. I don’t think MySQL’s AS statement accepts anything other than a simple text label.

    I think putting your internationalization into the database schema level is probably the wrong idea; it seems like you can keep your life more sane by keeping that translation level in your web application (php) layer. After all, your users should never need to see directly what the name of your columns are, right?

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

Sidebar

Related Questions

Say I have two tables as outlined below: mysql> show columns from ping; +------------+------------------+------+-----+---------+----------------+
Scenario: Let's say I have two tables, TableA and TableB. TableB's primary key is
Can someone please help me with MySQL Trigger Lets say I have two Tables
I have two MySQL tables say A and B. A contains just one varchar
Say I have two tables: object id name object_event id object_id type date I
Let's say I have 3 tables (significant columns only) Category (catId key , parentCatId)
I have a mysql problem. Let's say for example I have two tables with
Ive got a problem with a MySQL query. Let's say, we have two tables:
Let's say I have this MySQL table: OK.. see the type field? Type 0
Say I have these two mysql tables: country ---- username Country John USA Sarah

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.