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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:58:22+00:00 2026-06-18T08:58:22+00:00

SELECT * FROM Table JOIN Other ON Table.id = Other.tableId I’m structuring a MySQL

  • 0
SELECT * FROM Table JOIN Other ON Table.id = Other.tableId

I’m structuring a MySQL wrapper, and wondering if the “ON” keyword is used only in conjunction with joins (like above), or somewhere else as well?

  • 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-18T08:58:23+00:00Added an answer on June 18, 2026 at 8:58 am

    The ON keyword is also found and can be in several other places, like CREATE TABLE and ALTER TABLE table statements (in the FOREIGN KEY definitions: ON DELETE CASCADE), in the CREATE TRIGGER syntax (ON tbl_name FOR EACH ROW), in the CREATE INDEX statements, etc.


    For joins, the JOIN syntax in the MySQL documentation has it all:

    MySQL supports the following JOIN syntaxes for the table_references part of SELECT statements and multiple-table DELETE and UPDATE statements:

    table_references:
        table_reference [, table_reference] ...
    
    table_reference:
        table_factor
      | join_table
    
    table_factor:
        tbl_name [[AS] alias] [index_hint_list]
      | table_subquery [AS] alias
      | ( table_references )
      | { OJ table_reference LEFT OUTER JOIN table_reference
            ON conditional_expr }
    
    join_table:
        table_reference [INNER | CROSS] JOIN table_factor [join_condition]
      | table_reference STRAIGHT_JOIN table_factor
      | table_reference STRAIGHT_JOIN table_factor ON conditional_expr
      | table_reference {LEFT|RIGHT} [OUTER] JOIN table_reference join_condition
      | table_reference NATURAL [{LEFT|RIGHT} [OUTER]] JOIN table_factor
    
    join_condition:
        ON conditional_expr
      | USING (column_list)
    

    So, ON can be used in SELECT, UPDATE and DELETE statements. It can be used with JOIN, LEFT JOIN, RIGHT JOIN (and the equivalent INNER JOIN, LEFT OUTER JOIN, RIGHT OUTER JOIN).

    Either ON or USING is to be used, not both.

    It cannot be used with NATURAL JOIN (of course.)

    And some differences from the ANSI/ISO SQL standard:

    • you can use ON with CROSS JOIN.

    • also (optionally) with STRAIGHT_JOIN (that’s a MySQL addition)

    • you can use JOIN and INNER JOIN without ON.

    • UPDATE and DELETE syntax has some differences with the standard, too.

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

Sidebar

Related Questions

I have the following MySQL query statement: SELECT * FROM table1 INNER JOIN table2
I need to select data from two table using a join. This is fairly
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
SELECT * FROM TableA INNER JOIN TableB ON TableA.name = TableB.name SELECT * FROM
Here is my query select * from table1 inner join table2 on table1.typeId=table2.typeId; This
i'm joining tables like: select * from tableA a full join tableB b on
I'm trying to execute the following SQL: SELECT * FROM Table2 INNER JOIN (SELECT
How to select all columns from tables in join using linq Sql: select CTRL_RUN_JOB.*,
Whats the difference between SELECT DISTINCT field1 FROM table1 cd JOIN table2 ON cd.Company

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.