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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T17:22:34+00:00 2026-06-15T17:22:34+00:00

Possible Duplicate: MySQL ON vs USING? Query 1: SELECT * FROM users JOIN orders

  • 0

Possible Duplicate:
MySQL ON vs USING?

Query 1:

SELECT *
FROM users
JOIN orders ON (orders.user_id = users.user_id)
WHERE users.user_id = 1;

Query 2:

SELECT *
FROM users
JOIN orders USING (user_id)
WHERE user_id = 1;

I want to join orders and users tables to get some certain data. It works fine. My issue is since both queries output the same results set, is it the same? Which one is more efficient to be used? Which one is good for performance ? Which one is the best practise ?

  • 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-15T17:22:35+00:00Added an answer on June 15, 2026 at 5:22 pm

    The USING clause is something we don’t need to mention in the JOIN condition when we are retrieving data from multiple tables. When we use a USING clause, that particular column name should be present in both tables, and the SELECT query will automatically join those tables using the given column name in the USING clause.

    For example, if there are two common column names in the table, then mention the desired common column name in the USING clause.

    USING is also used while executing Dynamic SQL, like so:

    EXECUTE IMMEDIATE 'DELETE FROM dept WHERE deptno = :num'
      USING dept_id; 
    
    • The USING clause: This allows you to specify the join key by name.

    • The ON clause: This syntax allows you to specify the column names for join keys in both tables.

    The USING clause

    The USING clause is used if several columns share the same name but you don’t want to join using all of these common columns. The columns listed in the USING clause can’t have any qualifiers in the statement, including the WHERE clause.

    The ON clause

    The ON clause is used to join tables where the column names don’t match in both tables. The join conditions are removed from the filter conditions in the WHERE clause.

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

Sidebar

Related Questions

Possible Duplicate: PHP MySQL multiple search query using option / select HTML form tags
Possible Duplicate: How to only select numeric data from mysql? Hi, I want to
Possible Duplicate: MySQL query using an array How to use an array of values
Possible Duplicate: MySQL query using an array Passing an array to mysql I have
Possible Duplicate: SQL exclude a column using SELECT * [except columnA] FROM tableA? I
Possible Duplicate: MySQL select join where AND where Well, I have a table -
Possible Duplicate: Can you put placeholders in select part of a query using PDO?
Possible Duplicate: SQL Query with MySQL I implement a Rest Web Service (JAX-RS) using
Possible Duplicate: mysql: Using LIMIT within GROUP BY to get N results per group?
Possible Duplicate: mySQL - Insert into three tables I want to know if I

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.