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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T19:58:49+00:00 2026-06-07T19:58:49+00:00

I am trying to do a query with an outer join, and I’ve always

  • 0

I am trying to do a query with an outer join, and I’ve always used Oracle Pl/SQL in the past, but am now trying to learn MySQL. I’m trying to join 3 tables, USERS, USER_TYPE, and GRADE. The USERS table contains column, USER_TYPE_ID, which is a foreign key to USER_TYPE, and it also contains column, GRADE_ID which is a foreign key to GRADE. I need the outer join because user types could be student, faculty, etc, and if it is a faculty member then the USER does not have a grade, hence a NULL GRADE_ID in the USER table. Here is what my query would have looked like in the past using (+) for the outer join.

SELECT A.USER_NAME
     , A.USER_TYPE_ID
     , B.USER_TYPE_DESC
     , A.GRADE_ID
     , C.GRADE_DESC
  FROM USERS A
     , USER_TYPE B
     , GRADE C
 WHERE A.USER_TYPE_ID = B.USER_TYPE_ID
   AND A.GRADE_ID = C.GRADE_ID (+);

Could someone please help me translate this into a MySQL query?

Thanks in advance!

  • 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-07T19:58:51+00:00Added an answer on June 7, 2026 at 7:58 pm
    SELECT u.user_name, u.user_type_id, ut.user_type_desc, u.grade_id, g.grade_desc
    FROM users u JOIN user_type ut ON (ut.user_type_id = u.user_type_id)
    LEFT JOIN grade g ON (u.grade_id = g.grade_id);
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have folowing MYsql Query And Trying to right outer join but unable to
I'm trying to generate a SQL query that can join two tables together and
I'm trying to query a MySQL database using an array but I'm having trouble!
I am trying to do a LEFT JOIN in Hibernate Query Language, in MySQL
I am trying to write a SQL query that pulls from 3 tables and
I am trying to query data from two tables into one tables using OUTER
I'm trying to build a query using HQL and OUTER JOIN s and just
I'm trying to get a query to compare two tables by LEFT OUTER JOINing
I have a three different tables that I'm trying to join up correctly but
SQL 2005: I am trying to create an outer join that will pull records

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.