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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T22:25:58+00:00 2026-05-26T22:25:58+00:00

SELECT * FROM left_table OUTER JOIN right_table on left_table.name = righ t_table.name; SELECT *

  • 0
SELECT * FROM left_table OUTER JOIN right_table on left_table.name = righ
t_table.name;

SELECT * FROM left_table FULL OUTER JOIN right_table on left_table.name =
 right_table.name;

These 2 statements gives below error. Are they not valid mysql statements ?

ERROR 1064 (42000): You have an error in your SQL syntax; check the manual that
corresponds to your MySQL server version for the right syntax to use near 'OUTER
 JOIN right_table on left_table.name = right_table.name' at line 1


mysql> SELECT * FROM left_table RIGHT OUTER JOIN right_table on left_table.name
= right_table.name;

and

mysql> SELECT * FROM left_table RIGHT JOIN right_table on left_table.name
= right_table.name;

give same result. So whats the basic use of adding OUTER in statement?

I want to know what special purpose does it serve by adding OUTER in statement where as without adding it also its returning same output.

—- Update —-

Ok i give my table structure

mysql> select * from left_table;
+----+---------+
| id | name    |
+----+---------+
|  1 | Pirate  |
|  2 | money   |
|  5 | Ninja   |
|  6 | pradeep |
+----+---------+

and

mysql> select * from right_table;
+----+-------------+
| id | name        |
+----+-------------+
|  1 | Rutabaga    |
|  2 | Pirate      |
|  3 | Darth Vader |
|  4 | Ninja       |
+----+-------------+

I ran statements like

mysql> SELECT * FROM left_table LEFT JOIN right_table on left_table.name = right
_table.name where right_table.id is NULL;
+----+---------+------+------+
| id | name    | id   | name |
+----+---------+------+------+
|  2 | money   | NULL | NULL |
|  6 | pradeep | NULL | NULL |
+----+---------+------+------+

and

mysql> SELECT * FROM left_table LEFT OUTER JOIN right_table on left_table.name =
 right_table.name where right_table.id is NULL;
+----+---------+------+------+
| id | name    | id   | name |
+----+---------+------+------+
|  2 | money   | NULL | NULL |
|  6 | pradeep | NULL | NULL |
+----+---------+------+------+

They still produce the same output. SO if any1 can show some statement where the results will differ. i would be able to understand it.

  • 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-26T22:25:59+00:00Added an answer on May 26, 2026 at 10:25 pm

    They may, in your specific testing case, produce the same results. However, they will not always.

    An outer join, instead of an inner join, means still show results from the main table (which depends on whether you’re using left or right outer join) even if there is no corresponding row in the secondary table.

    An inner join would not show the result at all if there was a row in the main table that matched the WHERE conditions but did not have a row that it could join with in the secondary table.

    If your tables that you’re joining in testing have matching rows for every result (i.e. every row in left_table has a row in right_table with the same value in the name field), then you won’t see any difference.

    What would make a difference is if you had some rows in one table, or in each table, that didn’t have a row in the other table.

    For:
    select * from left_table left outer join right_table on...where... and there are some rows in the right_table that meet the conditionals (in the where) but don’t have a row in the left_table, they would not show. But if there were rows in the left_table that meet the conditionals without a joining row in the right_table, they would still show.

    Same goes reverse for RIGHT OUTER JOIN.

    EDIT:

    LEFT JOIN and LEFT OUTER JOIN are aliases of each other. They are the same thing. I would just use OUTER to clarify for your own sake, if you’d like. I prefer to always use OUTER or INNER just so I can look quickly and see what I did.

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

Sidebar

Related Questions

Is this equivalent to a LEFT JOIN ? SELECT DISTINCT a.name, b.name FROM tableA
Two snippets of MySQL: SELECT * FROM annoyingly_long_left_hand_table LEFT JOIN annoyingly_long_right_hand_table ON annoyingly_long_left_hand_table.id =
I've seen people writing the following query SELECT column_name(s) FROM table_name1 LEFT JOIN table_name2
My query string is like: SELECT ... FROM maintable LEFT JOIN table1 on (maintable.id
If I run the following SQL query SELECT * FROM A LEFT JOIN B
Which query would run faster? SELECT * FROM topic_info LEFT JOIN topic_data ON topic_info.id
SELECT * FROM tbl_group_join tgj LEFT JOIN tbl_groups tg ON tg.group_id = tgj.group_id LEFT
Any idea why query SELECT m.* FROM products_description pd, products p left join manufacturers
In this query: SELECT COUNT(*) AS UserCount, Company.* FROM Company LEFT JOIN User ON
I have a left outer join (below) returning results as expected. I need to

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.