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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T08:21:17+00:00 2026-06-05T08:21:17+00:00

Problem: I am trying to translate the id in two columns in a grading

  • 0

Problem:

I am trying to “translate” the id in two columns in a grading table (betyg_essays) to the real names of those users in another table (betyg_users).

The grading table (betyg_essays) look like this:

enter image description here

The user table (betyg_users) looks like this:

enter image description here

PHP code (so far):

$query = 'SELECT * FROM betyg_essays JOIN betyg_users ON betyg_essays.Examiner = betyg_users.UID';

Examiner/Supervisor columns (betyg_essays) correspond to the UID column (betyg_users).

Desired output should be (using the Firstname/Lastname columns):

  1. Examiner: John Hopkins. Supervisor: Mike Baker.
  2. Examiner: John Hopkins. Supervisor: Mike Baker.

Non-working SQL query:

$query = "SELECT 
            (u1.Firstname + ' ' + u1.Lastname) AS Examiner, 
            (u2.Firstname + ' ' + u2.Lastname) AS Supervisor
        FROM betyg_essays grade
            INNER JOIN betyg_users u1 ON grade.Examiner = u1.UID
            INNER JOIN betyg_users u2 ON grade.Supervisor = u2.UID";
  • 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-05T08:21:21+00:00Added an answer on June 5, 2026 at 8:21 am
    SELECT
    CONCAT(u1.FirstName, ' ', u1.LastName) AS Examiner,
    CONCAT(u2.FirstName, ' ', u2.LastName) AS Supervisor
    FROM betyg_essays e
    INNER JOIN betyg_users u1 ON e.Examiner = u1.UID
    INNER JOIN betyg_users u2 ON e.Supervisor = u2.UID
    

    I didn’t tried the code, you might need to make some adjustments.

    UPDATE: Fixed the id’s

    INNER JOIN betyg_users u2 ON e.Supervisor = u2.UID
    

    UPDATE2:

    I have changed the + to CONCAT function. Apparently, MySQL handles string differently then SQL Server.

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

Sidebar

Related Questions

I'm trying to translate this line of Javascript code to Jquery. The problem i'm
I'm trying to translate an online html page into text. I have a problem
I'm facing a problem trying to call Compile() on the LambdaExpression of type Expression<Func<MyType,
I'm having a problem trying to getline lines from a .txt file. I used
I have a small problem trying to unzip a file using the 7za command-line
having a problem trying to get an arraylist containing arraylists to work in my
I have a problem trying to apply rules about direct matches in a football[soccer]
I came across this problem trying to improve performance on manipulating huge lists of
I am having a problem trying to use the prependTo() function in jQuery... for
I'm having a problem trying to format the output on the jQuery UI datepicker.

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.